home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1994-10-19 | 78.5 KB | [ONLN/HLX2] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Mon Oct 17 07:27:35 1994, modified Wed Oct 19 10:32:31 1994, creator 'HLX2', type 'ONLN', 76694 bytes "TB37 Pending Update Perils" , at 0x12c16 3348 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
100%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [ONLN] |
macFileCreator | [HLX2] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 1a 54 42 33 37 20 50 | 65 6e 64 69 6e 67 20 55 |..TB37 P|ending U|
|00000010| 70 64 61 74 65 20 50 65 | 72 69 6c 73 00 00 00 00 |pdate Pe|rils....|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 01 2b 96 00 | 00 0d 14 aa c8 10 27 aa |.....+..|......'.|
|00000060| ca de 7f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 36 51 00 00 |........|....6Q..|
|00000080| 54 42 20 33 37 20 2d 20 | 50 65 6e 64 69 6e 67 20 |TB 37 - |Pending |
|00000090| 55 70 64 61 74 65 20 50 | 65 72 69 6c 73 0d 54 6f |Update P|erils.To|
|000000a0| 6f 6c 62 6f 78 09 0d 52 | 65 76 69 73 65 64 20 62 |olbox..R|evised b|
|000000b0| 79 3a 09 43 2e 4b 2e 20 | 48 61 75 6e 20 3c 54 52 |y:.C.K. |Haun <TR|
|000000c0| 3e 09 4f 63 74 6f 62 65 | 72 20 20 31 39 39 31 0d |>.Octobe|r 1991.|
|000000d0| 57 72 69 74 74 65 6e 20 | 62 79 3a 09 43 2e 4b 2e |Written |by:.C.K.|
|000000e0| 20 48 61 75 6e 20 3c 54 | 52 3e 09 41 75 67 75 73 | Haun <T|R>.Augus|
|000000f0| 74 20 20 31 39 39 31 0d | 54 68 69 73 20 54 65 63 |t 1991.|This Tec|
|00000100| 68 6e 69 63 61 6c 20 4e | 6f 74 65 20 64 69 73 63 |hnical N|ote disc|
|00000110| 75 73 73 65 73 20 70 6f | 74 65 6e 74 69 61 6c 20 |usses po|tential |
|00000120| 70 72 6f 62 6c 65 6d 73 | 20 77 68 65 6e 20 70 65 |problems| when pe|
|00000130| 6e 64 69 6e 67 20 75 70 | 64 61 74 65 20 65 76 65 |nding up|date eve|
|00000140| 6e 74 73 20 66 6f 72 20 | 77 69 6e 64 6f 77 73 20 |nts for |windows |
|00000150| 62 65 68 69 6e 64 20 6d | 6f 64 61 6c 20 64 69 61 |behind m|odal dia|
|00000160| 6c 6f 67 73 20 61 72 65 | 20 6e 6f 74 20 73 65 72 |logs are| not ser|
|00000170| 76 69 63 65 64 2e 20 20 | 54 68 69 73 20 6e 6f 74 |viced. |This not|
|00000180| 65 20 61 6c 73 6f 20 64 | 6f 63 75 6d 65 6e 74 73 |e also d|ocuments|
|00000190| 20 73 6f 6d 65 20 6e 65 | 77 20 53 79 73 74 65 6d | some ne|w System|
|000001a0| 20 37 20 44 69 61 6c 6f | 67 20 4d 61 6e 61 67 65 | 7 Dialo|g Manage|
|000001b0| 72 20 63 61 6c 6c 73 2e | 0d 43 68 61 6e 67 65 73 |r calls.|.Changes|
|000001c0| 20 73 69 6e 63 65 20 41 | 75 67 75 73 74 20 31 39 | since A|ugust 19|
|000001d0| 39 31 3a 20 20 41 64 64 | 65 64 20 6e 6f 74 65 20 |91: Add|ed note |
|000001e0| 63 6c 61 72 69 66 79 69 | 6e 67 20 68 6f 77 20 74 |clarifyi|ng how t|
|000001f0| 6f 20 75 73 65 20 74 68 | 65 20 6e 65 77 20 63 61 |o use th|e new ca|
|00000200| 6c 6c 73 2c 20 64 6f 63 | 75 6d 65 6e 74 65 64 20 |lls, doc|umented |
|00000210| 75 73 65 20 6f 66 20 53 | 74 64 46 69 6c 74 65 72 |use of S|tdFilter|
|00000220| 50 72 6f 63 20 69 6e 20 | 49 6e 74 65 72 66 61 63 |Proc in |Interfac|
|00000230| 65 2e 6f 2c 61 6e 64 20 | 63 6f 72 72 65 63 74 65 |e.o,and |correcte|
|00000240| 64 20 63 6f 64 65 20 65 | 72 72 6f 72 73 2e 0d 49 |d code e|rrors..I|
|00000250| 6e 74 72 6f 64 75 63 74 | 69 6f 6e 0d 4d 6f 64 61 |ntroduct|ion.Moda|
|00000260| 6c 20 64 69 61 6c 6f 67 | 20 62 6f 78 65 73 20 68 |l dialog| boxes h|
|00000270| 61 76 65 20 61 6c 77 61 | 79 73 20 63 61 75 73 65 |ave alwa|ys cause|
|00000280| 64 20 73 6f 6d 65 20 70 | 72 6f 62 6c 65 6d 73 20 |d some p|roblems |
|00000290| 77 69 74 68 20 20 77 69 | 6e 64 6f 77 73 20 62 65 |with wi|ndows be|
|000002a0| 68 69 6e 64 20 64 69 61 | 6c 6f 67 20 77 69 6e 64 |hind dia|log wind|
|000002b0| 6f 77 73 2e 20 20 53 69 | 6e 63 65 20 74 68 65 20 |ows. Si|nce the |
|000002c0| 4d 6f 64 61 6c 44 69 61 | 6c 6f 67 20 63 61 6c 6c |ModalDia|log call|
|000002d0| 20 6d 61 6b 65 73 20 61 | 6e 20 69 6e 74 65 72 6e | makes a|n intern|
|000002e0| 61 6c 20 65 76 65 6e 74 | 20 63 61 6c 6c 20 74 68 |al event| call th|
|000002f0| 61 74 20 62 79 70 61 73 | 73 65 73 20 79 6f 75 72 |at bypas|ses your|
|00000300| 20 6e 6f 72 6d 61 6c 20 | 65 76 65 6e 74 20 6c 6f | normal |event lo|
|00000310| 6f 70 20 79 6f 75 20 68 | 61 76 65 20 61 6c 77 61 |op you h|ave alwa|
|00000320| 79 73 20 68 61 64 20 74 | 68 65 20 70 6f 74 65 6e |ys had t|he poten|
|00000330| 74 69 61 6c 20 66 6f 72 | 20 6e 6f 74 20 6b 6e 6f |tial for| not kno|
|00000340| 77 69 6e 67 20 74 68 61 | 74 20 75 70 64 61 74 65 |wing tha|t update|
|00000350| 73 20 68 61 76 65 20 6f | 63 63 75 72 65 64 20 66 |s have o|ccured f|
|00000360| 6f 72 20 74 68 65 20 6f | 74 68 65 72 20 77 69 6e |or the o|ther win|
|00000370| 64 6f 77 73 20 69 6e 20 | 20 79 6f 75 72 20 61 70 |dows in | your ap|
|00000380| 70 6c 69 63 61 74 69 6f | 6e 20 77 68 65 6e 20 79 |plicatio|n when y|
|00000390| 6f 75 20 61 72 65 20 69 | 6e 20 61 20 4d 6f 64 61 |ou are i|n a Moda|
|000003a0| 6c 44 69 61 6c 6f 67 20 | 6c 6f 6f 70 2e 0d 49 66 |lDialog |loop..If|
|000003b0| 20 79 6f 75 d5 76 65 20 | 65 76 65 72 20 77 72 69 | you.ve |ever wri|
|000003c0| 74 74 65 6e 20 61 20 66 | 69 6c 74 65 72 20 70 72 |tten a f|ilter pr|
|000003d0| 6f 63 65 64 75 72 65 20 | 66 6f 72 20 61 20 6d 6f |ocedure |for a mo|
|000003e0| 64 61 6c 20 64 69 61 6c | 6f 67 2c 20 79 6f 75 d5 |dal dial|og, you.|
|000003f0| 76 65 20 70 72 6f 62 61 | 62 6c 79 20 73 65 65 6e |ve proba|bly seen|
|00000400| 20 74 68 69 73 20 66 6f | 72 20 79 6f 75 72 73 65 | this fo|r yourse|
|00000410| 6c 66 2e 20 20 59 6f 75 | 72 20 66 69 6c 74 65 72 |lf. You|r filter|
|00000420| 20 77 69 6c 6c 20 67 65 | 74 20 20 61 20 63 6f 6e | will ge|t a con|
|00000430| 74 69 6e 75 61 6c 20 73 | 74 72 65 61 6d 20 6f 66 |tinual s|tream of|
|00000440| 20 75 70 64 61 74 65 20 | 65 76 65 6e 74 73 2e 20 | update |events. |
|00000450| 54 68 65 73 65 20 65 76 | 65 6e 74 73 20 61 72 65 |These ev|ents are|
|00000460| 20 6e 6f 74 20 66 6f 72 | 20 74 68 65 20 64 69 61 | not for| the dia|
|00000470| 6c 6f 67 2c 20 62 75 74 | 20 61 72 65 20 66 6f 72 |log, but| are for|
|00000480| 20 74 68 65 20 77 69 6e | 64 6f 77 20 62 65 68 69 | the win|dow behi|
|00000490| 6e 64 20 74 68 65 20 64 | 69 61 6c 6f 67 2c 20 77 |nd the d|ialog, w|
|000004a0| 68 69 63 68 20 68 61 73 | 20 6e 6f 74 20 62 65 65 |hich has| not bee|
|000004b0| 6e 20 75 70 64 61 74 65 | 64 20 73 69 6e 63 65 20 |n update|d since |
|000004c0| 74 68 65 20 6d 6f 64 61 | 6c 20 64 69 61 6c 6f 67 |the moda|l dialog|
|000004d0| 20 63 61 6d 65 20 75 70 | 2e 20 20 53 69 6e 63 65 | came up|. Since|
|000004e0| 20 74 68 65 20 65 76 65 | 6e 74 20 68 61 73 20 6e | the eve|nt has n|
|000004f0| 6f 74 20 63 6f 6d 65 20 | 74 68 72 6f 75 67 68 20 |ot come |through |
|00000500| 79 6f 75 72 20 6e 6f 72 | 6d 61 6c 20 65 76 65 6e |your nor|mal even|
|00000510| 74 20 6c 6f 6f 70 20 79 | 6f 75 20 68 61 76 65 20 |t loop y|ou have |
|00000520| 70 72 6f 62 61 62 6c 79 | 20 6e 6f 74 20 73 65 72 |probably| not ser|
|00000530| 76 69 63 65 64 20 74 68 | 65 20 75 70 64 61 74 65 |viced th|e update|
|00000540| 20 73 69 6e 63 65 20 79 | 6f 75 20 61 72 65 20 6f | since y|ou are o|
|00000550| 6e 6c 79 20 63 6f 6e 63 | 65 72 6e 65 64 20 61 62 |nly conc|erned ab|
|00000560| 6f 75 74 20 65 76 65 6e | 74 73 20 66 6f 72 20 79 |out even|ts for y|
|00000570| 6f 75 72 20 64 69 61 6c | 6f 67 2c 20 73 6f 20 69 |our dial|og, so i|
|00000580| 74 20 6b 65 65 70 73 20 | 67 65 74 74 69 6e 67 20 |t keeps |getting |
|00000590| 72 65 73 65 6e 74 2e 20 | 20 54 68 65 20 6f 6e 6c |resent. | The onl|
|000005a0| 79 20 77 61 79 20 66 6f | 72 20 74 68 65 20 75 70 |y way fo|r the up|
|000005b0| 64 61 74 65 20 74 6f 20 | 73 74 6f 70 20 69 73 20 |date to |stop is |
|000005c0| 66 6f 72 20 74 68 65 20 | 75 70 64 61 74 65 20 72 |for the |update r|
|000005d0| 65 67 69 6f 6e 20 6f 66 | 20 74 68 65 20 61 66 66 |egion of| the aff|
|000005e0| 65 63 74 65 64 20 77 69 | 6e 64 6f 77 20 74 6f 20 |ected wi|ndow to |
|000005f0| 62 65 20 63 6c 65 61 72 | 65 64 2c 20 62 79 20 74 |be clear|ed, by t|
|00000600| 68 65 20 42 65 67 69 6e | 2f 45 6e 64 55 70 64 61 |he Begin|/EndUpda|
|00000610| 74 65 20 63 61 6c 6c 73 | 20 69 6e 20 79 6f 75 72 |te calls| in your|
|00000620| 20 64 72 61 77 69 6e 67 | 20 72 6f 75 74 69 6e 65 | drawing| routine|
|00000630| 20 28 73 65 65 20 74 68 | 65 20 64 69 73 63 75 73 | (see th|e discus|
|00000640| 73 69 6f 6e 20 6f 66 20 | 75 70 64 61 74 65 20 68 |sion of |update h|
|00000650| 61 6e 64 6c 69 6e 67 20 | 69 6e 20 49 6e 73 69 64 |andling |in Insid|
|00000660| 65 20 4d 61 63 20 49 2c | 20 74 68 65 20 57 69 6e |e Mac I,| the Win|
|00000670| 64 6f 77 20 4d 61 6e 61 | 67 65 72 20 63 68 61 70 |dow Mana|ger chap|
|00000680| 74 65 72 29 2e 0d 54 68 | 69 73 20 73 69 74 75 61 |ter)..Th|is situa|
|00000690| 74 69 6f 6e 20 69 73 20 | 65 78 61 63 65 72 62 61 |tion is |exacerba|
|000006a0| 74 65 64 20 62 79 20 73 | 63 72 65 65 6e 20 73 61 |ted by s|creen sa|
|000006b0| 76 65 72 73 20 6f 72 20 | 42 61 6c 6c 6f 6f 6e 20 |vers or |Balloon |
|000006c0| 48 65 6c 70 20 69 6e 20 | 53 79 73 74 65 6d 20 37 |Help in |System 7|
|000006d0| 2e 20 20 49 66 20 61 20 | 73 63 72 65 65 6e 20 73 |. If a |screen s|
|000006e0| 61 76 65 72 20 62 65 63 | 6f 6d 65 73 20 61 63 74 |aver bec|omes act|
|000006f0| 69 76 65 20 77 68 69 6c | 65 20 61 20 6d 6f 64 61 |ive whil|e a moda|
|00000700| 6c 20 64 69 61 6c 6f 67 | 20 69 73 20 75 70 2c 20 |l dialog| is up, |
|00000710| 6f 72 20 69 66 20 79 6f | 75 72 20 75 73 65 72 20 |or if yo|ur user |
|00000720| 68 61 73 20 42 61 6c 6c | 6f 6f 6e 20 68 65 6c 70 |has Ball|oon help|
|00000730| 20 6f 6e 20 61 6e 64 20 | 70 61 72 74 20 6f 66 20 | on and |part of |
|00000740| 61 20 62 65 68 69 6e 64 | 20 77 69 6e 64 6f 77 20 |a behind| window |
|00000750| 69 73 20 6f 62 73 63 75 | 72 65 64 20 62 79 20 61 |is obscu|red by a|
|00000760| 20 62 61 6c 6c 6f 6f 6e | 2c 20 74 68 65 6e 20 61 | balloon|, then a|
|00000770| 6e 20 75 70 64 61 74 65 | 20 65 76 65 6e 74 20 77 |n update| event w|
|00000780| 69 6c 6c 20 62 65 20 67 | 65 6e 65 72 61 74 65 64 |ill be g|enerated|
|00000790| 20 66 6f 72 20 74 68 65 | 20 62 65 68 69 6e 64 20 | for the| behind |
|000007a0| 77 69 6e 64 6f 77 2c 20 | 61 6e 64 20 79 6f 75 20 |window, |and you |
|000007b0| 6e 6f 72 6d 61 6c 6c 79 | 20 68 61 76 65 20 6e 6f |normally| have no|
|000007c0| 20 77 61 79 20 74 6f 20 | 63 6c 65 61 72 20 69 74 | way to |clear it|
|000007d0| 2e 0d 54 68 65 20 55 70 | 64 61 74 65 20 41 6e 64 |..The Up|date And|
|000007e0| 20 4d 6f 64 61 6c 20 44 | 69 61 6c 6f 67 0d 55 6e | Modal D|ialog.Un|
|000007f0| 64 65 72 20 53 79 73 74 | 65 6d 20 37 20 28 20 61 |der Syst|em 7 ( a|
|00000800| 6e 64 20 69 6e 20 53 79 | 73 74 65 6d 20 36 20 75 |nd in Sy|stem 6 u|
|00000810| 6e 64 65 72 20 20 4d 75 | 6c 74 69 46 69 6e 64 65 |nder Mu|ltiFinde|
|00000820| 72 29 2c 20 69 66 20 74 | 68 65 72 65 20 69 73 20 |r), if t|here is |
|00000830| 61 6e 20 75 70 64 61 74 | 65 20 65 76 65 6e 74 20 |an updat|e event |
|00000840| 70 65 6e 64 69 6e 67 20 | 66 6f 72 20 79 6f 75 72 |pending |for your|
|00000850| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 2c 20 6e 6f | applica|tion, no|
|00000860| 20 6f 74 68 65 72 20 61 | 70 70 6c 69 63 61 74 69 | other a|pplicati|
|00000870| 6f 6e 73 2c 20 64 72 69 | 76 65 72 73 2c 20 63 6f |ons, dri|vers, co|
|00000880| 6e 74 72 6f 6c 20 70 61 | 6e 65 6c 73 2c 20 6f 72 |ntrol pa|nels, or|
|00000890| 20 61 6e 79 74 68 69 6e | 67 20 65 6c 73 65 20 77 | anythin|g else w|
|000008a0| 69 6c 6c 20 67 65 74 20 | 74 69 6d 65 2e 0d 55 70 |ill get |time..Up|
|000008b0| 64 61 74 65 73 20 70 65 | 6e 64 69 6e 67 20 66 6f |dates pe|nding fo|
|000008c0| 72 20 6f 74 68 65 72 20 | 61 70 70 6c 69 63 61 74 |r other |applicat|
|000008d0| 69 6f 6e 73 20 64 6f 20 | 6e 6f 74 20 63 61 75 73 |ions do |not caus|
|000008e0| 65 20 74 68 65 20 70 72 | 6f 62 6c 65 6d 2c 20 74 |e the pr|oblem, t|
|000008f0| 68 65 79 20 77 69 6c 6c | 20 62 65 20 68 61 6e 64 |hey will| be hand|
|00000900| 6c 65 64 20 6e 6f 72 6d | 61 6c 6c 79 20 62 79 20 |led norm|ally by |
|00000910| 74 68 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |the appl|ication |
|00000920| 69 6e 20 74 68 65 20 62 | 61 63 6b 67 72 6f 75 6e |in the b|ackgroun|
|00000930| 64 2e 20 20 42 75 74 20 | 75 70 64 61 74 65 73 20 |d. But |updates |
|00000940| 66 6f 72 20 74 68 65 20 | 66 72 6f 6e 74 6d 6f 73 |for the |frontmos|
|00000950| 74 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 6d 75 |t applic|ation mu|
|00000960| 73 74 20 62 65 20 73 65 | 72 76 69 63 65 64 20 6f |st be se|rviced o|
|00000970| 72 20 74 68 65 20 6f 74 | 68 65 72 20 61 70 70 6c |r the ot|her appl|
|00000980| 69 63 61 74 69 6f 6e 73 | 20 77 69 6c 6c 20 6e 6f |ications| will no|
|00000990| 74 20 67 65 74 20 74 69 | 6d 65 2e 0d 54 68 69 73 |t get ti|me..This|
|000009a0| 20 69 73 20 61 20 70 6f | 74 65 6e 74 69 61 6c 20 | is a po|tential |
|000009b0| 42 61 64 20 54 68 69 6e | 67 2e 20 4d 61 6e 79 20 |Bad Thin|g. Many |
|000009c0| 70 69 65 63 65 73 20 6f | 66 20 63 6f 64 65 20 6e |pieces o|f code n|
|000009d0| 65 65 64 20 74 69 6d 65 | 20 74 6f 20 6b 65 65 70 |eed time| to keep|
|000009e0| 20 6c 69 76 69 6e 67 2c | 20 74 6f 20 6d 61 69 6e | living,| to main|
|000009f0| 74 61 69 6e 20 6e 65 74 | 77 6f 72 6b 20 63 6f 6e |tain net|work con|
|00000a00| 6e 65 63 74 69 6f 6e 73 | 2c 20 6f 72 20 6a 75 73 |nections|, or jus|
|00000a10| 74 20 74 6f 20 6c 6f 6f | 6b 20 67 6f 6f 64 2e 20 |t to loo|k good. |
|00000a20| 0d 41 20 73 69 6d 70 6c | 65 20 65 78 61 6d 70 6c |.A simpl|e exampl|
|00000a30| 65 20 69 73 20 74 68 65 | 20 43 6c 6f 63 6b 20 64 |e is the| Clock d|
|00000a40| 65 73 6b 20 61 63 63 65 | 73 73 6f 72 79 2e 20 20 |esk acce|ssory. |
|00000a50| 4f 70 65 6e 20 74 68 65 | 20 43 6c 6f 63 6b 20 44 |Open the| Clock D|
|00000a60| 41 2c 20 74 68 65 6e 20 | 6c 61 75 6e 63 68 20 61 |A, then |launch a|
|00000a70| 6e 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 74 68 |n applic|ation th|
|00000a80| 61 74 20 79 6f 75 20 6b | 6e 6f 77 20 68 61 73 20 |at you k|now has |
|00000a90| 61 20 6d 6f 64 61 6c 20 | 64 69 61 6c 6f 67 2e 20 |a modal |dialog. |
|00000aa0| 20 50 6f 73 69 74 69 6f | 6e 20 74 68 65 20 63 6c | Positio|n the cl|
|00000ab0| 6f 63 6b 20 73 6f 20 79 | 6f 75 20 63 61 6e 20 73 |ock so y|ou can s|
|00000ac0| 65 65 20 69 74 2c 20 61 | 6e 64 20 79 6f 75 d5 6c |ee it, a|nd you.l|
|00000ad0| 6c 20 6e 6f 74 69 63 65 | 20 74 68 61 74 20 69 74 |l notice| that it|
|00000ae0| 20 72 65 66 72 65 73 68 | 65 73 20 69 74 73 20 74 | refresh|es its t|
|00000af0| 69 6d 65 20 63 6f 75 6e | 74 20 65 76 65 6e 20 77 |ime coun|t even w|
|00000b00| 68 69 6c 65 20 69 74 d5 | 73 20 69 6e 20 74 68 65 |hile it.|s in the|
|00000b10| 20 62 61 63 6b 67 72 6f | 75 6e 64 2e 20 20 0d 4e | backgro|und. .N|
|00000b20| 6f 77 20 6d 61 6b 65 20 | 73 75 72 65 20 74 68 65 |ow make |sure the|
|00000b30| 72 65 20 69 73 20 61 20 | 64 6f 63 75 6d 65 6e 74 |re is a |document|
|00000b40| 20 77 69 6e 64 6f 77 20 | 6f 70 65 6e 20 69 6e 20 | window |open in |
|00000b50| 74 68 65 20 66 72 6f 6e | 74 6d 6f 73 74 20 61 70 |the fron|tmost ap|
|00000b60| 70 6c 69 63 61 74 69 6f | 6e 2e 20 20 54 75 72 6e |plicatio|n. Turn|
|00000b70| 20 6f 6e 20 42 61 6c 6c | 6f 6f 6e 20 48 65 6c 70 | on Ball|oon Help|
|00000b80| 20 66 72 6f 6d 20 74 68 | 65 20 48 65 6c 70 20 6d | from th|e Help m|
|00000b90| 65 6e 75 2e 0d 4f 70 65 | 6e 20 61 20 6d 6f 64 61 |enu..Ope|n a moda|
|00000ba0| 6c 20 64 69 61 6c 6f 67 | 20 69 6e 20 74 68 65 20 |l dialog| in the |
|00000bb0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 28 74 68 65 |applicat|ion (the|
|00000bc0| 20 41 62 6f 75 74 20 62 | 6f 78 20 69 6e 20 6d 6f | About b|ox in mo|
|00000bd0| 73 74 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 73 20 |st appli|cations |
|00000be0| 77 69 6c 6c 20 77 6f 72 | 6b 29 2e 20 20 4e 6f 77 |will wor|k). Now|
|00000bf0| 20 6d 6f 76 65 20 74 68 | 65 20 63 75 72 73 6f 72 | move th|e cursor|
|00000c00| 20 6f 76 65 72 20 74 68 | 65 20 77 69 6e 64 6f 77 | over th|e window|
|00000c10| 20 62 65 68 69 6e 64 20 | 74 68 65 20 6d 6f 64 61 | behind |the moda|
|00000c20| 6c 20 64 69 61 6c 6f 67 | 2e 20 20 41 20 62 61 6c |l dialog|. A bal|
|00000c30| 6c 6f 6f 6e 20 77 69 6c | 6c 20 61 70 70 65 61 72 |loon wil|l appear|
|00000c40| 20 73 61 79 69 6e 67 20 | 73 6f 6d 65 74 68 69 6e | saying |somethin|
|00000c50| 67 20 6c 69 6b 65 20 22 | 54 68 69 73 20 77 69 6e |g like "|This win|
|00000c60| 64 6f 77 20 69 73 20 6e | 6f 74 20 61 63 74 69 76 |dow is n|ot activ|
|00000c70| 65 20 62 65 63 61 75 73 | 65 20 61 20 64 69 61 6c |e becaus|e a dial|
|00000c80| 6f 67 20 62 6f 78 20 69 | 73 20 75 70 2e 2e 2e 2e |og box i|s up....|
|00000c90| 22 2c 20 61 6e 64 20 61 | 20 70 69 65 63 65 20 6f |", and a| piece o|
|00000ca0| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 20 77 69 6c |f the wi|ndow wil|
|00000cb0| 6c 20 62 65 20 62 6c 61 | 73 74 65 64 20 62 79 20 |l be bla|sted by |
|00000cc0| 74 68 65 20 62 61 6c 6c | 6f 6f 6e 2e 20 20 4e 6f |the ball|oon. No|
|00000cd0| 77 20 6c 6f 6f 6b 20 61 | 74 20 74 68 65 20 43 6c |w look a|t the Cl|
|00000ce0| 6f 63 6b 2e 20 20 49 74 | 20 68 61 73 20 73 74 6f |ock. It| has sto|
|00000cf0| 70 70 65 64 20 72 75 6e | 6e 69 6e 67 2e 20 20 54 |pped run|ning. T|
|00000d00| 68 65 20 77 69 6e 64 6f | 77 20 74 68 61 74 20 67 |he windo|w that g|
|00000d10| 6f 74 20 7a 61 70 70 65 | 64 20 62 79 20 74 68 65 |ot zappe|d by the|
|00000d20| 20 62 61 6c 6c 6f 6f 6e | 20 6e 6f 77 20 68 61 73 | balloon| now has|
|00000d30| 20 61 6e 20 75 70 64 61 | 74 65 20 70 65 6e 64 69 | an upda|te pendi|
|00000d40| 6e 67 20 66 6f 72 20 69 | 74 2c 20 74 68 61 74 20 |ng for i|t, that |
|00000d50| 75 70 64 61 74 65 20 69 | 73 20 67 6f 69 6e 67 20 |update i|s going |
|00000d60| 74 68 72 6f 75 67 68 20 | 74 68 65 20 4d 6f 64 61 |through |the Moda|
|00000d70| 6c 44 69 61 6c 6f 67 20 | 74 72 61 70 2c 20 61 6e |lDialog |trap, an|
|00000d80| 64 20 6e 6f 74 20 74 68 | 72 6f 75 67 68 20 74 68 |d not th|rough th|
|00000d90| 65 20 70 72 6f 67 72 61 | 6d d5 73 20 65 76 65 6e |e progra|m.s even|
|00000da0| 74 20 6c 6f 6f 70 2c 20 | 73 6f 20 69 74 20 69 73 |t loop, |so it is|
|00000db0| 20 6e 6f 74 20 62 65 69 | 6e 67 20 73 65 72 76 69 | not bei|ng servi|
|00000dc0| 63 65 64 2e 20 20 54 69 | 6d 65 20 73 74 6f 70 73 |ced. Ti|me stops|
|00000dd0| 20 66 6f 72 20 61 6c 6c | 20 6f 74 68 65 72 20 61 | for all| other a|
|00000de0| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 0d 4e 6f 74 |pplicati|ons..Not|
|00000df0| 65 3a 09 54 68 69 73 20 | 6f 6e 6c 79 20 68 61 70 |e:.This |only hap|
|00000e00| 70 65 6e 73 20 69 66 20 | 74 68 65 20 75 70 64 61 |pens if |the upda|
|00000e10| 74 65 20 69 73 20 66 6f | 72 20 74 68 65 20 73 61 |te is fo|r the sa|
|00000e20| 6d 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 61 |me appli|cation a|
|00000e30| 73 20 74 68 65 20 64 69 | 61 6c 6f 67 20 62 6f 78 |s the di|alog box|
|00000e40| 2e 20 20 49 66 20 79 6f | 75 20 62 6c 61 73 74 20 |. If yo|u blast |
|00000e50| 61 20 77 69 6e 64 6f 77 | 20 69 6e 20 61 6e 6f 74 |a window| in anot|
|00000e60| 68 65 72 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |her appl|ication |
|00000e70| 28 6c 69 6b 65 20 74 68 | 65 20 46 69 6e 64 65 72 |(like th|e Finder|
|00000e80| 29 20 74 68 65 6e 20 74 | 68 61 74 20 75 70 64 61 |) then t|hat upda|
|00000e90| 74 65 20 77 69 6c 6c 20 | 62 65 20 70 72 6f 63 65 |te will |be proce|
|00000ea0| 73 73 65 64 20 6e 6f 72 | 6d 61 6c 6c 79 2e 0d 59 |ssed nor|mally..Y|
|00000eb0| 75 63 6b 2c 20 74 68 61 | 74 d5 73 20 6e 61 73 74 |uck, tha|t.s nast|
|00000ec0| 79 21 0d 59 6f 75 20 68 | 61 76 65 20 74 77 6f 20 |y!.You h|ave two |
|00000ed0| 63 68 6f 69 63 65 73 20 | 69 6e 20 79 6f 75 72 20 |choices |in your |
|00000ee0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 74 6f 20 70 |applicat|ion to p|
|00000ef0| 72 65 76 65 6e 74 20 74 | 68 69 73 20 66 72 6f 6d |revent t|his from|
|00000f00| 20 68 61 70 70 65 6e 69 | 6e 67 2e 20 20 54 68 65 | happeni|ng. The|
|00000f10| 20 66 69 72 73 74 20 69 | 73 20 74 6f 20 68 61 76 | first i|s to hav|
|00000f20| 65 20 6e 6f 20 6f 74 68 | 65 72 20 6f 70 65 6e 20 |e no oth|er open |
|00000f30| 77 69 6e 64 6f 77 73 20 | 69 6e 20 79 6f 75 72 20 |windows |in your |
|00000f40| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 77 68 65 6e |applicat|ion when|
|00000f50| 20 79 6f 75 20 6f 70 65 | 6e 20 61 20 6d 6f 64 61 | you ope|n a moda|
|00000f60| 6c 20 64 69 61 6c 6f 67 | 2e 20 20 4f 62 76 69 6f |l dialog|. Obvio|
|00000f70| 75 73 6c 79 2c 20 74 68 | 69 73 20 69 73 6e d5 74 |usly, th|is isn.t|
|00000f80| 20 61 20 72 65 61 6c 69 | 73 74 69 63 20 73 6f 6c | a reali|stic sol|
|00000f90| 75 74 69 6f 6e 2e 0d 54 | 68 65 20 73 65 63 6f 6e |ution..T|he secon|
|00000fa0| 64 2c 20 73 61 6e 65 72 | 2c 20 73 6f 6c 75 74 69 |d, saner|, soluti|
|00000fb0| 6f 6e 20 69 73 20 74 6f | 20 70 72 6f 76 69 64 65 |on is to| provide|
|00000fc0| 20 79 6f 75 72 73 65 6c | 66 20 61 20 6d 65 63 68 | yoursel|f a mech|
|00000fd0| 61 6e 69 73 6d 20 74 6f | 20 72 65 66 72 65 73 68 |anism to| refresh|
|00000fe0| 20 61 6c 6c 20 79 6f 75 | 72 20 77 69 6e 64 6f 77 | all you|r window|
|00000ff0| 73 20 66 72 6f 6d 20 77 | 69 74 68 69 6e 20 79 6f |s from w|ithin yo|
|00001000| 75 72 20 6d 6f 64 61 6c | 20 64 69 61 6c 6f 67 2e |ur modal| dialog.|
|00001010| 0d 41 20 66 69 6c 74 65 | 72 20 70 72 6f 63 65 64 |.A filte|r proced|
|00001020| 75 72 65 20 28 64 65 73 | 63 72 69 62 65 64 20 69 |ure (des|cribed i|
|00001030| 6e 20 74 68 65 20 44 69 | 61 6c 6f 67 20 4d 61 6e |n the Di|alog Man|
|00001040| 61 67 65 72 20 63 68 61 | 70 74 65 72 20 6f 66 20 |ager cha|pter of |
|00001050| 49 6e 73 69 64 65 20 4d | 61 63 20 76 6f 6c 75 6d |Inside M|ac volum|
|00001060| 65 20 49 29 20 69 73 20 | 74 68 65 20 70 72 6f 70 |e I) is |the prop|
|00001070| 65 72 20 74 6f 6f 6c 20 | 74 6f 20 75 73 65 20 74 |er tool |to use t|
|00001080| 6f 20 66 69 78 20 74 68 | 69 73 20 70 72 6f 62 6c |o fix th|is probl|
|00001090| 65 6d 2e 20 20 59 6f 75 | d5 6c 6c 20 6e 65 65 64 |em. You|.ll need|
|000010a0| 20 74 6f 20 61 64 64 20 | 61 20 73 69 6d 70 6c 65 | to add |a simple|
|000010b0| 20 66 69 6c 74 65 72 20 | 70 72 6f 63 65 64 75 72 | filter |procedur|
|000010c0| 65 20 74 6f 20 65 76 65 | 72 79 20 64 69 61 6c 6f |e to eve|ry dialo|
|000010d0| 67 20 6f 72 20 61 6c 65 | 72 74 20 79 6f 75 20 62 |g or ale|rt you b|
|000010e0| 72 69 6e 67 20 75 70 20 | 69 6e 20 79 6f 75 72 20 |ring up |in your |
|000010f0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 20 20 41 6e |applicat|ion. An|
|00001100| 64 2c 20 69 6e 20 6d 6f | 73 74 20 63 61 73 65 73 |d, in mo|st cases|
|00001110| 2c 20 69 74 20 63 61 6e | 20 62 65 20 74 68 65 20 |, it can| be the |
|00001120| 73 61 6d 65 20 66 69 6c | 74 65 72 20 66 6f 72 20 |same fil|ter for |
|00001130| 65 76 65 72 79 20 64 69 | 61 6c 6f 67 2c 20 73 6f |every di|alog, so|
|00001140| 20 69 74 d5 73 20 6e 6f | 74 20 61 20 67 72 65 61 | it.s no|t a grea|
|00001150| 74 20 64 65 61 6c 20 6f | 66 20 65 78 74 72 61 20 |t deal o|f extra |
|00001160| 63 6f 64 65 2e 20 0d 20 | 0d 59 6f 75 d5 72 65 20 |code. . |.You.re |
|00001170| 67 6f 69 6e 67 20 74 6f | 20 68 61 76 65 20 74 6f |going to| have to|
|00001180| 20 64 6f 20 61 20 6c 69 | 74 74 6c 65 20 70 72 65 | do a li|ttle pre|
|00001190| 70 61 72 61 74 69 6f 6e | 20 74 6f 20 64 6f 20 74 |paration| to do t|
|000011a0| 68 69 73 2e 20 20 59 6f | 75 72 20 66 69 6c 74 65 |his. Yo|ur filte|
|000011b0| 72 20 70 72 6f 63 20 6e | 65 65 64 73 20 74 6f 20 |r proc n|eeds to |
|000011c0| 68 61 76 65 20 61 20 77 | 61 79 20 74 6f 20 63 61 |have a w|ay to ca|
|000011d0| 6c 6c 20 74 68 65 20 64 | 72 61 77 69 6e 67 20 70 |ll the d|rawing p|
|000011e0| 72 6f 63 65 64 75 72 65 | 20 66 6f 72 20 61 6e 79 |rocedure| for any|
|000011f0| 20 6f 66 20 79 6f 75 72 | 20 77 69 6e 64 6f 77 73 | of your| windows|
|00001200| 2e 20 20 54 68 65 72 65 | 20 61 72 65 20 6d 61 6e |. There| are man|
|00001210| 79 20 77 61 79 73 20 74 | 6f 20 64 6f 20 74 68 69 |y ways t|o do thi|
|00001220| 73 2c 20 64 69 63 74 61 | 74 65 64 20 62 79 20 74 |s, dicta|ted by t|
|00001230| 68 65 20 73 70 65 63 69 | 66 69 63 20 6e 65 65 64 |he speci|fic need|
|00001240| 73 20 6f 66 20 79 6f 75 | 72 20 61 70 70 6c 69 63 |s of you|r applic|
|00001250| 61 74 69 6f 6e 20 61 6e | 64 20 79 6f 75 72 20 6f |ation an|d your o|
|00001260| 77 6e 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 73 |wn progr|amming s|
|00001270| 74 79 6c 65 2e 20 20 20 | 59 6f 75 20 6d 61 79 20 |tyle. |You may |
|00001280| 77 61 6e 74 20 74 6f 20 | 63 72 65 61 74 65 20 61 |want to |create a|
|00001290| 20 77 69 6e 64 6f 77 20 | 63 6f 6e 74 72 6f 6c 20 | window |control |
|000012a0| 6f 62 6a 65 63 74 20 74 | 68 61 74 20 63 6f 6e 74 |object t|hat cont|
|000012b0| 61 69 6e 73 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |ains a p|ointer t|
|000012c0| 6f 20 79 6f 75 72 20 64 | 72 61 77 69 6e 67 20 72 |o your d|rawing r|
|000012d0| 6f 75 74 69 6e 65 2c 20 | 79 6f 75 20 6d 61 79 20 |outine, |you may |
|000012e0| 77 61 6e 74 20 74 6f 20 | 69 6e 63 6c 75 64 65 20 |want to |include |
|000012f0| 74 68 65 20 73 61 6d 65 | 20 63 68 65 63 6b 20 61 |the same| check a|
|00001300| 6e 64 20 64 69 73 70 61 | 74 63 68 20 79 6f 75 20 |nd dispa|tch you |
|00001310| 68 61 76 65 20 69 6e 20 | 79 6f 75 72 20 6d 61 69 |have in |your mai|
|00001320| 6e 20 65 76 65 6e 74 20 | 6c 6f 6f 70 2c 20 6f 72 |n event |loop, or|
|00001330| 20 75 73 65 20 61 6e 6f | 74 68 65 72 20 6d 65 74 | use ano|ther met|
|00001340| 68 6f 64 20 77 68 69 63 | 68 20 79 6f 75 20 61 72 |hod whic|h you ar|
|00001350| 65 20 63 6f 6d 66 6f 72 | 74 61 62 6c 65 20 77 69 |e comfor|table wi|
|00001360| 74 68 2e 0d 20 0d 54 68 | 65 20 73 69 6d 70 6c 65 |th.. .Th|e simple|
|00001370| 73 74 2c 20 62 61 72 65 | 20 62 6f 6e 65 73 20 6d |st, bare| bones m|
|00001380| 65 74 68 6f 64 2c 20 77 | 6f 75 6c 64 20 62 65 20 |ethod, w|ould be |
|00001390| 74 6f 20 69 6e 63 6c 75 | 64 65 20 61 20 66 6c 61 |to inclu|de a fla|
|000013a0| 67 20 66 6f 72 20 79 6f | 75 72 20 20 64 72 61 77 |g for yo|ur draw|
|000013b0| 69 6e 67 20 70 72 6f 63 | 65 64 75 72 65 20 69 6e |ing proc|edure in|
|000013c0| 20 79 6f 75 72 20 77 69 | 6e 64 6f 77 20 72 65 63 | your wi|ndow rec|
|000013d0| 6f 72 64 20 72 65 66 43 | 6f 6e 2c 20 61 6e 64 20 |ord refC|on, and |
|000013e0| 68 61 76 65 20 79 6f 75 | 72 20 64 72 61 77 69 6e |have you|r drawin|
|000013f0| 67 20 72 6f 75 74 69 6e | 65 20 76 65 63 74 6f 72 |g routin|e vector|
|00001400| 20 62 61 73 65 64 20 6f | 6e 20 74 68 65 20 76 61 | based o|n the va|
|00001410| 6c 75 65 20 69 6e 20 74 | 68 65 20 72 65 66 43 6f |lue in t|he refCo|
|00001420| 6e 2c 20 61 73 20 73 68 | 6f 77 6e 20 68 65 72 65 |n, as sh|own here|
|00001430| 2e 20 0d 49 6e 20 4d 50 | 57 20 43 0d 2f 2a 20 57 |. .In MP|W C./* W|
|00001440| 69 6e 64 6f 77 20 64 72 | 61 77 69 6e 67 20 70 72 |indow dr|awing pr|
|00001450| 6f 63 2c 20 64 65 66 69 | 6e 65 64 20 73 6f 6d 65 |oc, defi|ned some|
|00001460| 77 68 65 72 65 20 65 6c | 73 65 20 2a 2f 20 0d 42 |where el|se */ .B|
|00001470| 6f 6f 6c 65 61 6e 20 4d | 79 44 72 61 77 50 72 6f |oolean M|yDrawPro|
|00001480| 63 28 57 69 6e 64 6f 77 | 50 74 72 20 77 69 6e 64 |c(Window|Ptr wind|
|00001490| 6f 77 54 6f 44 72 61 77 | 29 0d 7b 0d 42 6f 6f 6c |owToDraw|).{.Bool|
|000014a0| 65 61 6e 20 72 65 74 75 | 72 6e 56 61 6c 20 3d 20 |ean retu|rnVal = |
|000014b0| 74 72 75 65 3b 0d 2f 2a | 20 73 77 69 74 63 68 20 |true;./*| switch |
|000014c0| 6f 66 66 20 74 68 65 20 | 76 61 6c 75 65 20 79 6f |off the |value yo|
|000014d0| 75 d5 76 65 20 73 74 6f | 72 65 64 20 69 6e 20 79 |u.ve sto|red in y|
|000014e0| 6f 75 72 20 77 69 6e 64 | 6f 77 20 65 61 72 6c 69 |our wind|ow earli|
|000014f0| 65 72 20 2a 2f 0d 73 77 | 69 74 63 68 28 47 65 74 |er */.sw|itch(Get|
|00001500| 57 52 65 66 43 6f 6e 28 | 77 69 6e 64 6f 77 54 6f |WRefCon(|windowTo|
|00001510| 44 72 61 77 29 29 20 7b | 0d 09 63 61 73 65 20 6b |Draw)) {|..case k|
|00001520| 4d 79 43 6c 69 70 62 6f | 61 72 64 3a 09 2f 2a 20 |MyClipbo|ard:./* |
|00001530| 64 72 61 77 20 6d 79 20 | 63 6c 69 70 62 6f 61 72 |draw my |clipboar|
|00001540| 64 20 2a 2f 0d 09 44 72 | 61 77 4d 79 43 6c 69 70 |d */..Dr|awMyClip|
|00001550| 28 77 69 6e 64 6f 77 54 | 6f 44 72 61 77 29 3b 0d |(windowT|oDraw);.|
|00001560| 20 09 62 72 65 61 6b 3b | 0d 09 63 61 73 65 20 6b | .break;|..case k|
|00001570| 4d 79 44 6f 63 75 6d 65 | 6e 74 3a 09 2f 2a 20 64 |MyDocume|nt:./* d|
|00001580| 6f 63 75 6d 65 6e 74 20 | 63 6f 6e 74 65 6e 74 20 |ocument |content |
|00001590| 2a 2f 0d 09 44 72 61 77 | 4d 79 44 6f 63 28 77 69 |*/..Draw|MyDoc(wi|
|000015a0| 6e 64 6f 77 54 6f 44 72 | 61 77 29 3b 0d 09 62 72 |ndowToDr|aw);..br|
|000015b0| 65 61 6b 3b 0d 09 64 65 | 66 61 75 6c 74 3a 09 09 |eak;..de|fault:..|
|000015c0| 2f 2a 20 64 6f 20 6e 6f | 74 68 69 6e 67 20 66 6f |/* do no|thing fo|
|000015d0| 72 20 61 6e 79 74 68 69 | 6e 67 20 65 6c 73 65 2c |r anythi|ng else,|
|000015e0| 20 74 6f 20 70 72 65 76 | 65 6e 74 20 64 72 61 77 | to prev|ent draw|
|000015f0| 69 6e 67 20 09 09 09 09 | 2f 2a 20 77 69 6e 64 6f |ing ....|/* windo|
|00001600| 77 20 2a 2f 0d 09 72 65 | 74 75 72 6e 56 61 6c 20 |w */..re|turnVal |
|00001610| 3d 20 66 61 6c 73 65 3b | 09 2f 2a 20 74 68 61 74 |= false;|./* that|
|00001620| 20 69 73 6e d5 74 20 6d | 69 6e 65 20 2a 2f 0d 09 | isn.t m|ine */..|
|00001630| 62 72 65 61 6b 3b 09 7d | 0d 2f 2a 20 74 68 69 73 |break;.}|./* this|
|00001640| 20 72 65 74 75 72 6e 20 | 76 61 6c 75 65 20 69 73 | return |value is|
|00001650| 20 75 73 65 64 20 74 6f | 20 74 65 6c 6c 20 74 68 | used to| tell th|
|00001660| 65 20 44 69 61 6c 6f 67 | 20 4d 61 6e 61 67 65 72 |e Dialog| Manager|
|00001670| 20 69 66 20 79 6f 75 d5 | 76 65 20 68 61 6e 64 6c | if you.|ve handl|
|00001680| 65 64 20 74 68 65 20 75 | 70 64 61 74 65 20 2f 2a |ed the u|pdate /*|
|00001690| 20 6f 72 20 6e 6f 74 20 | 77 68 65 6e 20 74 68 69 | or not |when thi|
|000016a0| 73 20 69 73 20 63 61 6c | 6c 65 64 20 66 72 6f 6d |s is cal|led from|
|000016b0| 20 79 6f 75 72 20 66 69 | 6c 74 65 72 2e 20 20 49 | your fi|lter. I|
|000016c0| 6e 20 6e 6f 72 6d 61 6c | 20 75 73 65 73 20 28 69 |n normal| uses (i|
|000016d0| 2e 65 2e 20 69 6e 20 72 | 65 73 70 6f 6e 73 65 20 |.e. in r|esponse |
|000016e0| 74 6f 20 20 2f 2a 20 61 | 6e 20 75 70 64 61 74 65 |to /* a|n update|
|000016f0| 45 76 65 6e 74 20 69 6e | 20 79 6f 75 72 20 6d 61 |Event in| your ma|
|00001700| 69 6e 20 65 76 65 6e 74 | 20 6c 6f 6f 70 29 20 74 |in event| loop) t|
|00001710| 68 65 20 62 6f 6f 6c 65 | 61 6e 20 69 73 20 75 6e |he boole|an is un|
|00001720| 6e 65 63 65 73 73 61 72 | 79 2c 20 62 75 74 20 69 |necessar|y, but i|
|00001730| 74 0d 2f 2a 20 64 6f 65 | 73 6e d5 74 20 64 6f 20 |t./* doe|sn.t do |
|00001740| 61 6e 79 20 68 61 72 6d | 20 2a 2f 0d 72 65 74 75 |any harm| */.retu|
|00001750| 72 6e 28 72 65 74 75 72 | 6e 56 61 6c 29 3b 0d 7d |rn(retur|nVal);.}|
|00001760| 0d 2f 2a 20 69 6e 73 74 | 61 6c 6c 20 74 68 65 20 |./* inst|all the |
|00001770| 66 6c 61 67 20 77 68 65 | 6e 20 49 20 63 72 65 61 |flag whe|n I crea|
|00001780| 74 65 20 74 68 65 20 77 | 69 6e 64 6f 77 20 2a 2f |te the w|indow */|
|00001790| 0d 6d 79 57 69 6e 64 6f | 77 50 74 72 20 3d 20 47 |.myWindo|wPtr = G|
|000017a0| 65 74 4e 65 77 57 69 6e | 64 6f 77 28 6b 4d 79 57 |etNewWin|dow(kMyW|
|000017b0| 69 6e 64 6f 77 49 44 2c | 6e 69 6c 2c 28 57 69 6e |indowID,|nil,(Win|
|000017c0| 64 6f 77 50 74 72 29 2d | 31 29 3b 0d 53 65 74 57 |dowPtr)-|1);.SetW|
|000017d0| 52 65 66 43 6f 6e 28 6d | 79 57 69 6e 64 6f 77 50 |RefCon(m|yWindowP|
|000017e0| 74 72 2c 20 28 6c 6f 6e | 67 29 6d 79 44 72 61 77 |tr, (lon|g)myDraw|
|000017f0| 69 6e 67 50 72 6f 63 46 | 6c 61 67 29 3b 0d 49 6e |ingProcF|lag);.In|
|00001800| 20 79 6f 75 72 20 66 69 | 6c 74 65 72 2c 20 74 68 | your fi|lter, th|
|00001810| 65 20 75 70 64 61 74 65 | 20 68 61 6e 64 6c 69 6e |e update| handlin|
|00001820| 67 20 77 6f 75 6c 64 20 | 6c 6f 6f 6b 20 73 6f 6d |g would |look som|
|00001830| 65 74 68 69 6e 67 20 6c | 69 6b 65 20 74 68 69 73 |ething l|ike this|
|00001840| 0d 69 66 28 74 68 65 45 | 76 65 6e 74 49 6e 2d 3e |.if(theE|ventIn->|
|00001850| 77 68 61 74 20 3d 3d 20 | 75 70 64 61 74 65 45 76 |what == |updateEv|
|00001860| 74 20 26 26 20 20 74 68 | 65 45 76 65 6e 74 49 6e |t && th|eEventIn|
|00001870| 2d 3e 6d 65 73 73 61 67 | 65 20 21 3d 20 6d 79 44 |->messag|e != myD|
|00001880| 69 61 6c 6f 67 50 74 72 | 20 29 20 7b 0d 2f 2a 20 |ialogPtr| ) {./* |
|00001890| 69 66 20 74 68 65 20 75 | 70 64 61 74 65 20 69 73 |if the u|pdate is|
|000018a0| 20 66 6f 72 20 74 68 65 | 20 64 69 61 6c 6f 67 20 | for the| dialog |
|000018b0| 62 6f 78 2c 20 69 67 6e | 6f 72 65 20 69 74 20 73 |box, ign|ore it s|
|000018c0| 69 6e 63 65 20 74 68 65 | 20 72 65 67 75 6c 61 72 |ince the| regular|
|000018d0| 20 4d 6f 64 61 6c 44 69 | 61 6c 6f 67 0d 20 20 20 | ModalDi|alog. |
|000018e0| 77 69 6c 6c 20 72 65 64 | 72 61 77 20 69 74 20 61 |will red|raw it a|
|000018f0| 73 20 6e 65 63 65 73 73 | 61 72 79 20 2a 2f 09 0d |s necess|ary */..|
|00001900| 72 65 74 75 72 6e 28 4d | 79 44 72 61 77 50 72 6f |return(M|yDrawPro|
|00001910| 63 28 28 57 69 6e 64 6f | 77 50 74 72 29 74 68 65 |c((Windo|wPtr)the|
|00001920| 45 76 65 6e 74 49 6e 2d | 3e 6d 65 73 73 61 67 65 |EventIn-|>message|
|00001930| 29 29 3b 20 0d 2f 2a 20 | 67 6f 20 74 6f 20 6d 79 |)); ./* |go to my|
|00001940| 20 64 72 61 77 69 6e 67 | 20 72 6f 75 74 69 6e 65 | drawing| routine|
|00001950| 2c 20 77 69 6e 64 6f 77 | 20 77 69 6c 6c 20 62 65 |, window| will be|
|00001960| 20 72 65 64 72 61 77 6e | 20 69 66 20 49 20 6f 77 | redrawn| if I ow|
|00001970| 6e 20 69 74 20 2a 2f 0d | 7d 0d 49 6e 20 4d 50 57 |n it */.|}.In MPW|
|00001980| 20 50 61 73 63 61 6c 0d | 7b 20 54 68 65 20 66 75 | Pascal.|{ The fu|
|00001990| 6e 63 74 69 6f 6e d5 73 | 20 72 65 73 75 6c 74 20 |nction.s| result |
|000019a0| 69 73 20 75 73 65 64 20 | 74 6f 20 74 65 6c 6c 20 |is used |to tell |
|000019b0| 74 68 65 20 44 69 61 6c | 6f 67 20 4d 61 6e 61 67 |the Dial|og Manag|
|000019c0| 65 72 20 69 66 20 79 6f | 75 d5 76 65 20 68 61 6e |er if yo|u.ve han|
|000019d0| 64 6c 65 64 20 74 68 65 | 0d 29 0d 28 75 70 64 61 |dled the|.).(upda|
|000019e0| 74 65 20 6f 72 20 6e 6f | 74 20 77 68 65 6e 20 74 |te or no|t when t|
|000019f0| 68 69 73 20 69 73 20 63 | 61 6c 6c 65 64 20 66 72 |his is c|alled fr|
|00001a00| 6f 6d 20 79 6f 75 72 20 | 66 69 6c 74 65 72 2e 20 |om your |filter. |
|00001a10| 20 49 6e 20 6e 6f 72 6d | 61 6c 20 75 73 65 73 20 | In norm|al uses |
|00001a20| 28 69 2e 65 2e 20 69 6e | 0d 29 0d 28 20 72 65 73 |(i.e. in|.).( res|
|00001a30| 70 6f 6e 73 65 20 74 6f | 20 61 6e 20 75 70 64 61 |ponse to| an upda|
|00001a40| 74 65 45 76 65 6e 74 20 | 69 6e 20 79 6f 75 72 20 |teEvent |in your |
|00001a50| 6d 61 69 6e 20 65 76 65 | 6e 74 20 6c 6f 6f 70 29 |main eve|nt loop)|
|00001a60| 20 74 68 65 20 62 6f 6f | 6c 65 61 6e 20 69 73 20 | the boo|lean is |
|00001a70| 75 6e 6e 65 63 65 73 73 | 61 72 79 2c 20 0d 29 0d |unnecess|ary, .).|
|00001a80| 28 62 75 74 20 69 74 20 | 64 6f 65 73 6e d5 74 20 |(but it |doesn.t |
|00001a90| 64 6f 20 61 6e 79 20 68 | 61 72 6d 2e 20 54 68 65 |do any h|arm. The|
|00001aa0| 20 77 69 6e 64 6f 77 20 | 64 72 61 77 69 6e 67 20 | window |drawing |
|00001ab0| 70 72 6f 63 65 64 75 72 | 65 20 69 73 20 64 65 66 |procedur|e is def|
|00001ac0| 69 6e 65 64 20 73 6f 6d | 65 77 68 65 72 65 20 65 |ined som|ewhere e|
|00001ad0| 6c 73 65 2e 20 7d 0d 46 | 55 4e 43 54 49 4f 4e 20 |lse. }.F|UNCTION |
|00001ae0| 4d 79 44 72 61 77 50 72 | 6f 63 28 77 69 6e 64 6f |MyDrawPr|oc(windo|
|00001af0| 77 54 6f 44 72 61 77 20 | 57 69 6e 64 6f 77 50 74 |wToDraw |WindowPt|
|00001b00| 72 29 3a 20 42 4f 4f 4c | 45 41 4e 3b 0d 42 45 47 |r): BOOL|EAN;.BEG|
|00001b10| 49 4e 0d 20 20 43 41 53 | 45 20 47 65 74 57 52 65 |IN. CAS|E GetWRe|
|00001b20| 66 43 6f 6e 28 77 69 6e | 64 6f 77 50 74 72 29 20 |fCon(win|dowPtr) |
|00001b30| 4f 46 0d 20 20 20 20 6b | 4d 79 43 6c 69 70 62 6f |OF. k|MyClipbo|
|00001b40| 61 72 64 3a 0d 20 20 20 | 20 20 20 42 45 47 49 4e |ard:. | BEGIN|
|00001b50| 0d 20 20 20 20 20 20 20 | 20 44 72 61 77 4d 79 43 |. | DrawMyC|
|00001b60| 6c 69 70 62 6f 61 72 64 | 28 77 69 6e 64 6f 77 54 |lipboard|(windowT|
|00001b70| 6f 44 72 61 77 29 3b 0d | 20 20 20 20 20 20 20 20 |oDraw);.| |
|00001b80| 4d 79 44 72 61 77 50 72 | 6f 63 20 3a 3d 20 54 52 |MyDrawPr|oc := TR|
|00001b90| 55 45 3b 0d 20 20 20 20 | 20 20 45 4e 44 3b 0d 20 |UE;. | END;. |
|00001ba0| 20 20 20 6b 4d 79 44 6f | 63 75 6d 65 6e 74 3a 0d | kMyDo|cument:.|
|00001bb0| 20 20 20 20 20 20 42 45 | 47 49 4e 0d 20 20 20 20 | BE|GIN. |
|00001bc0| 20 20 20 20 44 72 61 77 | 4d 79 44 6f 63 75 6d 65 | Draw|MyDocume|
|00001bd0| 6e 74 28 77 69 6e 64 6f | 77 54 6f 44 72 61 77 29 |nt(windo|wToDraw)|
|00001be0| 3b 0d 20 20 20 20 20 20 | 20 20 4d 79 44 72 61 77 |;. | MyDraw|
|00001bf0| 50 72 6f 63 20 3a 3d 20 | 54 52 55 45 3b 0d 20 20 |Proc := |TRUE;. |
|00001c00| 20 20 20 20 45 4e 44 3b | 0d 20 20 20 20 4f 54 48 | END;|. OTH|
|00001c10| 45 52 57 49 53 45 0d 20 | 20 20 20 20 20 4d 79 44 |ERWISE. | MyD|
|00001c20| 72 61 77 50 72 6f 63 20 | 3a 3d 20 46 41 4c 53 45 |rawProc |:= FALSE|
|00001c30| 3b 0d 20 20 20 45 4e 44 | 3b 20 7b 43 41 53 45 7d |;. END|; {CASE}|
|00001c40| 0d 45 4e 44 3b 0d 49 6e | 73 74 61 6c 6c 20 74 68 |.END;.In|stall th|
|00001c50| 65 20 66 6c 61 67 20 77 | 68 65 6e 20 79 6f 75 20 |e flag w|hen you |
|00001c60| 63 72 65 61 74 65 20 61 | 20 77 69 6e 64 6f 77 3a |create a| window:|
|00001c70| 0d 20 20 6d 79 57 69 6e | 64 6f 77 50 74 72 20 3a |. myWin|dowPtr :|
|00001c80| 3d 20 47 65 74 4e 65 77 | 57 69 6e 64 6f 77 28 6b |= GetNew|Window(k|
|00001c90| 4d 79 57 69 6e 64 6f 77 | 49 44 2c 20 4e 49 4c 2c |MyWindow|ID, NIL,|
|00001ca0| 20 57 69 6e 64 6f 77 50 | 74 72 28 2d 31 29 29 3b | WindowP|tr(-1));|
|00001cb0| 0d 20 20 53 65 74 57 52 | 65 66 43 6f 6e 28 6d 79 |. SetWR|efCon(my|
|00001cc0| 57 69 6e 64 6f 77 50 74 | 72 2c 20 6d 79 44 72 61 |WindowPt|r, myDra|
|00001cd0| 77 69 6e 67 50 72 6f 63 | 46 6c 61 67 29 3b 0d 49 |wingProc|Flag);.I|
|00001ce0| 6e 20 79 6f 75 72 20 66 | 69 6c 74 65 72 2c 20 74 |n your f|ilter, t|
|00001cf0| 68 65 20 75 70 64 61 74 | 65 20 68 61 6e 64 6c 69 |he updat|e handli|
|00001d00| 6e 67 20 77 6f 75 6c 64 | 20 6c 6f 6f 6b 20 73 6f |ng would| look so|
|00001d10| 6d 65 74 68 69 6e 67 20 | 6c 69 6b 65 20 74 68 69 |mething |like thi|
|00001d20| 73 3a 0d 46 55 4e 43 54 | 49 4f 4e 20 4d 79 46 69 |s:.FUNCT|ION MyFi|
|00001d30| 6c 74 65 72 28 63 75 72 | 72 65 6e 74 44 69 61 6c |lter(cur|rentDial|
|00001d40| 6f 67 3a 20 44 69 61 6c | 6f 67 50 74 72 3b 20 56 |og: Dial|ogPtr; V|
|00001d50| 41 52 20 74 68 65 45 76 | 65 6e 74 49 6e 3a 20 45 |AR theEv|entIn: E|
|00001d60| 76 65 6e 74 52 65 63 6f | 72 64 3b 20 56 41 52 20 |ventReco|rd; VAR |
|00001d70| 74 68 65 49 74 65 6d 3a | 20 49 4e 54 45 47 45 52 |theItem:| INTEGER|
|00001d80| 29 3a 20 42 4f 4f 4c 45 | 41 4e 3b 0d 7b 20 69 66 |): BOOLE|AN;.{ if|
|00001d90| 20 74 68 65 20 75 70 64 | 61 74 65 20 69 73 20 66 | the upd|ate is f|
|00001da0| 6f 72 20 74 68 65 20 64 | 69 61 6c 6f 67 20 62 6f |or the d|ialog bo|
|00001db0| 78 2c 20 69 67 6e 6f 72 | 65 20 69 74 20 73 69 6e |x, ignor|e it sin|
|00001dc0| 63 65 20 74 68 65 20 72 | 65 67 75 6c 61 72 20 4d |ce the r|egular M|
|00001dd0| 6f 64 61 6c 44 69 61 6c | 6f 67 0d 7b 20 66 75 6e |odalDial|og.{ fun|
|00001de0| 63 74 69 6f 6e 20 77 69 | 6c 6c 20 72 65 64 72 61 |ction wi|ll redra|
|00001df0| 77 20 69 74 20 61 73 20 | 6e 65 63 65 73 73 61 72 |w it as |necessar|
|00001e00| 79 20 7d 0d 42 45 47 49 | 4e 0d 20 20 49 46 20 28 |y }.BEGI|N. IF (|
|00001e10| 74 68 65 45 76 65 6e 74 | 49 6e 2e 77 68 61 74 20 |theEvent|In.what |
|00001e20| 3d 20 75 70 64 61 74 65 | 45 76 74 20 41 4e 44 20 |= update|Evt AND |
|00001e30| 74 68 65 45 76 65 6e 74 | 49 6e 2e 6d 65 73 73 61 |theEvent|In.messa|
|00001e40| 67 65 20 3c 3e 20 63 75 | 72 72 65 6e 74 44 69 61 |ge <> cu|rrentDia|
|00001e50| 6c 6f 67 29 0d 20 20 20 | 20 42 45 47 49 4e 0d 20 |log). | BEGIN. |
|00001e60| 20 20 20 20 20 4d 79 46 | 69 6c 74 65 72 20 3a 3d | MyF|ilter :=|
|00001e70| 20 4d 79 44 72 61 77 50 | 72 6f 63 28 63 75 72 72 | MyDrawP|roc(curr|
|00001e80| 65 6e 74 44 69 61 6c 6f | 67 29 3b 0d 20 20 20 20 |entDialo|g);. |
|00001e90| 45 4e 44 3b 0d 49 66 20 | 79 6f 75 20 64 6f 20 73 |END;.If |you do s|
|00001ea0| 6f 6d 65 2c 20 79 6f 75 | 20 68 61 76 65 20 74 6f |ome, you| have to|
|00001eb0| 20 64 6f 20 61 20 6c 69 | 74 74 6c 65 20 6d 6f 72 | do a li|ttle mor|
|00001ec0| 65 2e 2e 2e 2e 0d 54 68 | 65 20 6f 6e 6c 79 20 64 |e.....Th|e only d|
|00001ed0| 6f 77 6e 20 73 69 64 65 | 20 74 6f 20 61 64 64 69 |own side| to addi|
|00001ee0| 6e 67 20 79 6f 75 72 20 | 6f 77 6e 20 66 69 6c 74 |ng your |own filt|
|00001ef0| 65 72 20 70 72 6f 63 65 | 64 75 72 65 20 74 6f 20 |er proce|dure to |
|00001f00| 61 20 64 69 61 6c 6f 67 | 20 69 73 20 74 68 61 74 |a dialog| is that|
|00001f10| 20 74 68 65 20 44 69 61 | 6c 6f 67 20 4d 61 6e 61 | the Dia|log Mana|
|00001f20| 67 65 72 20 74 68 65 6e | 20 61 73 73 75 6d 65 73 |ger then| assumes|
|00001f30| 20 74 68 61 74 20 79 6f | 75 20 61 72 65 20 68 61 | that yo|u are ha|
|00001f40| 6e 64 69 6e 67 20 6d 6f | 72 65 20 74 68 61 6e 20 |nding mo|re than |
|00001f50| 6a 75 73 74 20 75 70 64 | 61 74 65 73 2e 20 20 53 |just upd|ates. S|
|00001f60| 70 65 63 69 66 69 63 61 | 6c 6c 79 2c 20 74 68 65 |pecifica|lly, the|
|00001f70| 20 44 69 61 6c 6f 67 20 | 4d 61 6e 61 67 65 72 20 | Dialog |Manager |
|00001f80| 61 73 73 75 6d 65 73 20 | 74 68 61 74 20 79 6f 75 |assumes |that you|
|00001f90| 20 61 72 65 20 68 61 6e | 64 6c 69 6e 67 20 74 68 | are han|dling th|
|00001fa0| 65 20 73 74 61 6e 64 61 | 72 64 20 22 72 65 74 75 |e standa|rd "retu|
|00001fb0| 72 6e 20 6b 65 79 20 61 | 6c 69 61 73 65 73 20 74 |rn key a|liases t|
|00001fc0| 6f 20 69 74 65 6d 20 31 | 22 20 66 69 6c 74 65 72 |o item 1|" filter|
|00001fd0| 69 6e 67 2e 20 20 53 6f | 2c 20 79 6f 75 20 6e 65 |ing. So|, you ne|
|00001fe0| 65 64 20 74 6f 20 77 72 | 69 74 65 20 20 6b 65 79 |ed to wr|ite key|
|00001ff0| 73 74 72 6f 6b 65 20 68 | 61 6e 64 6c 69 6e 67 20 |stroke h|andling |
|00002000| 20 69 6e 20 74 68 65 20 | 66 69 6c 74 65 72 20 79 | in the |filter y|
|00002010| 6f 75 72 73 65 6c 66 2e | 20 0d 54 68 65 20 44 69 |ourself.| .The Di|
|00002020| 61 6c 6f 67 20 4d 61 6e | 61 67 65 72 20 69 6e 20 |alog Man|ager in |
|00002030| 53 79 73 74 65 6d 20 37 | 20 68 61 73 20 73 6f 6d |System 7| has som|
|00002040| 65 20 6e 65 77 20 63 61 | 6c 6c 73 20 79 6f 75 20 |e new ca|lls you |
|00002050| 63 61 6e 20 6d 61 6b 65 | 20 74 6f 20 65 61 73 65 |can make| to ease|
|00002060| 20 74 68 65 20 6c 6f 61 | 64 20 6f 6e 20 79 6f 75 | the loa|d on you|
|00002070| 72 20 70 72 6f 67 72 61 | 6d 2e 20 20 54 68 65 73 |r progra|m. Thes|
|00002080| 65 20 63 61 6c 6c 73 20 | 77 65 72 65 20 63 72 65 |e calls |were cre|
|00002090| 61 74 65 64 20 61 6e 64 | 20 74 65 73 74 65 64 20 |ated and| tested |
|000020a0| 74 6f 6f 20 6c 61 74 65 | 20 69 6e 20 53 79 73 74 |too late| in Syst|
|000020b0| 65 6d 20 37 d5 73 20 64 | 65 76 65 6c 6f 70 6d 65 |em 7.s d|evelopme|
|000020c0| 6e 74 20 63 79 63 6c 65 | 20 74 6f 20 62 65 20 64 |nt cycle| to be d|
|000020d0| 6f 63 75 6d 65 6e 74 65 | 64 20 69 6e 20 49 6e 73 |ocumente|d in Ins|
|000020e0| 69 64 65 20 4d 61 63 69 | 6e 74 6f 73 68 2c 20 73 |ide Maci|ntosh, s|
|000020f0| 6f 20 74 68 65 79 20 61 | 72 65 20 70 72 65 73 65 |o they a|re prese|
|00002100| 6e 74 65 64 20 68 65 72 | 65 2e 20 20 54 68 65 79 |nted her|e. They|
|00002110| 20 61 6c 6c 6f 77 20 79 | 6f 75 20 74 6f 20 63 61 | allow y|ou to ca|
|00002120| 6c 6c 20 6f 6e 20 74 68 | 65 20 73 65 72 76 69 63 |ll on th|e servic|
|00002130| 65 73 20 6f 66 20 74 68 | 65 20 53 79 73 74 65 6d |es of th|e System|
|00002140| 20 74 6f 20 74 72 61 63 | 6b 20 73 74 61 6e 64 61 | to trac|k standa|
|00002150| 72 64 20 6b 65 79 73 74 | 72 6f 6b 65 73 20 69 6e |rd keyst|rokes in|
|00002160| 20 79 6f 75 72 20 64 69 | 61 6c 6f 67 2e 0d 4e 4f | your di|alog..NO|
|00002170| 54 45 3a 20 59 6f 75 20 | 6d 75 73 74 20 63 61 6c |TE: You |must cal|
|00002180| 6c 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 66 |l the st|andard f|
|00002190| 69 6c 74 65 72 20 70 72 | 6f 63 20 28 73 65 65 20 |ilter pr|oc (see |
|000021a0| 47 65 74 53 74 64 46 69 | 6c 74 65 72 50 72 6f 63 |GetStdFi|lterProc|
|000021b0| 20 62 65 6c 6f 77 29 20 | 66 6f 72 20 74 68 65 73 | below) |for thes|
|000021c0| 65 20 6e 65 77 20 63 61 | 6c 6c 73 20 74 6f 20 77 |e new ca|lls to w|
|000021d0| 6f 72 6b 20 70 72 6f 70 | 65 72 6c 79 2e 20 20 41 |ork prop|erly. A|
|000021e0| 75 74 6f 6d 61 74 69 63 | 20 63 75 72 73 6f 72 20 |utomatic| cursor |
|000021f0| 74 72 61 63 6b 69 6e 67 | 2c 20 64 65 66 61 75 6c |tracking|, defaul|
|00002200| 74 20 62 75 74 74 6f 6e | 20 62 6f 72 64 65 72 69 |t button| borderi|
|00002210| 6e 67 2c 20 61 6e 64 20 | 6b 65 79 73 74 72 6f 6b |ng, and |keystrok|
|00002220| 65 20 61 6c 69 61 73 69 | 6e 67 20 66 6f 72 20 4f |e aliasi|ng for O|
|00002230| 4b 20 61 6e 64 20 43 61 | 6e 63 65 6c 20 77 69 6c |K and Ca|ncel wil|
|00002240| 6c 20 6f 6e 6c 79 20 62 | 65 20 61 63 74 69 76 65 |l only b|e active|
|00002250| 20 69 66 20 79 6f 75 20 | 63 61 6c 6c 20 74 68 65 | if you |call the|
|00002260| 20 73 74 61 6e 64 61 72 | 64 20 66 69 6c 74 65 72 | standar|d filter|
|00002270| 20 70 72 6f 63 65 64 75 | 72 65 2e ca 20 20 41 6c | procedu|re.. Al|
|00002280| 73 6f 2c 20 74 68 65 73 | 65 20 63 61 6c 6c 73 20 |so, thes|e calls |
|00002290| 61 72 65 20 53 79 73 74 | 65 6d 20 37 20 73 70 65 |are Syst|em 7 spe|
|000022a0| 63 69 66 69 63 2e 20 20 | 59 6f 75 20 63 61 6e 6e |cific. |You cann|
|000022b0| 6f 74 20 75 73 65 20 74 | 68 65 6d 20 69 6e 20 70 |ot use t|hem in p|
|000022c0| 72 65 76 69 6f 75 73 20 | 73 79 73 74 65 6d 20 76 |revious |system v|
|000022d0| 65 72 73 69 6f 6e 73 2e | 0d 54 6f 20 6d 61 6b 65 |ersions.|.To make|
|000022e0| 20 74 68 69 6e 67 73 20 | 65 76 65 6e 20 65 61 73 | things |even eas|
|000022f0| 69 65 72 2c 20 4d 50 57 | 20 33 2e 32 20 61 6e 64 |ier, MPW| 3.2 and|
|00002300| 20 6c 61 74 65 72 20 63 | 6f 6e 74 61 69 6e 20 67 | later c|ontain g|
|00002310| 6c 75 65 20 63 6f 64 65 | 20 74 6f 20 61 6c 6c 6f |lue code| to allo|
|00002320| 77 20 79 6f 75 20 74 6f | 20 63 61 6c 6c 20 74 68 |w you to| call th|
|00002330| 65 20 73 74 61 6e 64 61 | 72 64 20 66 69 6c 74 65 |e standa|rd filte|
|00002340| 72 20 70 72 6f 63 65 64 | 75 72 65 20 77 69 74 68 |r proced|ure with|
|00002350| 6f 75 74 20 63 61 6c 6c | 69 6e 67 20 47 65 74 53 |out call|ing GetS|
|00002360| 74 64 46 69 6c 74 65 72 | 50 72 6f 63 20 61 6e 64 |tdFilter|Proc and|
|00002370| 20 64 69 73 70 61 74 63 | 68 69 6e 67 20 74 6f 20 | dispatc|hing to |
|00002380| 74 68 65 20 70 72 6f 63 | 65 64 75 72 65 20 70 6f |the proc|edure po|
|00002390| 69 6e 74 65 72 20 72 65 | 74 75 72 6e 65 64 2e 20 |inter re|turned. |
|000023a0| 20 54 68 65 20 67 6c 75 | 65 20 72 6f 75 74 69 6e | The glu|e routin|
|000023b0| 65 20 69 73 20 63 61 6c | 6c 65 64 20 53 74 64 46 |e is cal|led StdF|
|000023c0| 69 6c 74 65 72 50 72 6f | 63 20 61 6e 64 20 69 73 |ilterPro|c and is|
|000023d0| 20 63 6f 6e 74 61 69 6e | 65 64 20 69 6e 20 74 68 | contain|ed in th|
|000023e0| 65 20 49 6e 74 65 72 66 | 61 63 65 2e 6f 20 66 69 |e Interf|ace.o fi|
|000023f0| 6c 65 20 69 6e 20 74 68 | 65 20 73 74 61 6e 64 61 |le in th|e standa|
|00002400| 72 64 20 4d 50 57 20 6c | 69 62 72 61 72 69 65 73 |rd MPW l|ibraries|
|00002410| 2e 20 20 20 54 68 65 20 | 64 65 73 63 72 69 70 74 |. The |descript|
|00002420| 69 6f 6e 20 6f 66 20 74 | 68 65 20 63 61 6c 6c 20 |ion of t|he call |
|00002430| 69 73 20 69 6e 63 6c 75 | 64 65 64 20 62 65 6c 6f |is inclu|ded belo|
|00002440| 77 2e 20 20 49 66 20 79 | 6f 75 20 61 72 65 20 6e |w. If y|ou are n|
|00002450| 6f 74 20 75 73 69 6e 67 | 20 74 68 65 20 4d 50 57 |ot using| the MPW|
|00002460| 20 64 65 76 65 6c 6f 70 | 6d 65 6e 74 20 65 6e 76 | develop|ment env|
|00002470| 69 72 6f 6e 6d 65 6e 74 | 20 61 6e 64 20 64 6f 20 |ironment| and do |
|00002480| 6e 6f 74 20 68 61 76 65 | 20 61 63 63 65 73 73 20 |not have| access |
|00002490| 74 6f 20 74 68 65 20 4d | 50 57 20 6c 69 62 72 61 |to the M|PW libra|
|000024a0| 72 69 65 73 20 66 72 6f | 6d 20 79 6f 75 72 20 64 |ries fro|m your d|
|000024b0| 65 76 65 6c 6f 70 6d 65 | 6e 74 20 65 6e 76 69 72 |evelopme|nt envir|
|000024c0| 6f 6e 6d 65 6e 74 2c 20 | 79 6f 75 20 77 69 6c 6c |onment, |you will|
|000024d0| 20 6f 66 20 63 6f 75 72 | 73 65 20 68 61 76 65 20 | of cour|se have |
|000024e0| 74 6f 20 67 65 74 20 74 | 68 65 20 70 72 6f 63 65 |to get t|he proce|
|000024f0| 64 75 72 65 20 70 6f 69 | 6e 74 65 72 20 61 6e 64 |dure poi|nter and|
|00002500| 20 63 61 6c 6c 20 69 74 | 20 79 6f 75 72 73 65 6c | call it| yoursel|
|00002510| 66 2e 0d 4e 65 77 20 53 | 79 73 74 65 6d 20 37 20 |f..New S|ystem 7 |
|00002520| 44 69 61 6c 6f 67 20 4d | 61 6e 61 67 65 72 20 63 |Dialog M|anager c|
|00002530| 61 6c 6c 20 69 6e 74 65 | 72 66 61 63 65 73 0d 4d |all inte|rfaces.M|
|00002540| 50 57 20 43 0d 2f 2a 20 | 52 65 74 75 72 6e 73 20 |PW C./* |Returns |
|00002550| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the|
|00002560| 20 44 69 61 6c 6f 67 20 | 4d 61 6e 61 67 65 72 d5 | Dialog |Manager.|
|00002570| 73 20 73 74 61 6e 64 61 | 72 64 20 64 69 61 6c 6f |s standa|rd dialo|
|00002580| 67 20 66 69 6c 74 65 72 | 20 2a 2f 0d 70 61 73 63 |g filter| */.pasc|
|00002590| 61 6c 20 4f 53 45 72 72 | 20 47 65 74 53 74 64 46 |al OSErr| GetStdF|
|000025a0| 69 6c 74 65 72 50 72 6f | 63 28 4d 6f 64 61 6c 46 |ilterPro|c(ModalF|
|000025b0| 69 6c 74 65 72 50 72 6f | 63 50 74 72 20 2a 74 68 |ilterPro|cPtr *th|
|000025c0| 65 50 72 6f 63 20 29 0d | 09 3d 20 7b 20 30 78 33 |eProc ).|.= { 0x3|
|000025d0| 30 33 43 2c 20 30 78 30 | 32 30 33 2c 20 30 78 41 |03C, 0x0|203, 0xA|
|000025e0| 41 36 38 20 7d 3b 0d 2f | 2a 20 49 6e 64 69 63 61 |A68 };./|* Indica|
|000025f0| 74 65 73 20 74 6f 20 74 | 68 65 20 44 69 61 6c 6f |tes to t|he Dialo|
|00002600| 67 20 4d 61 6e 61 67 65 | 72 20 77 68 69 63 68 20 |g Manage|r which |
|00002610| 69 74 65 6d 20 69 73 20 | 64 65 66 61 75 6c 74 2e |item is |default.|
|00002620| 20 20 57 69 6c 6c 20 74 | 68 65 6e 20 61 6c 69 61 | Will t|hen alia|
|00002630| 73 20 74 68 65 0d 2f 2a | 20 72 65 74 75 72 6e 20 |s the./*| return |
|00002640| 26 20 65 6e 74 65 72 20 | 6b 65 79 73 20 74 6f 20 |& enter |keys to |
|00002650| 74 68 69 73 20 69 74 65 | 6d 2c 20 61 6e 64 20 61 |this ite|m, and a|
|00002660| 6c 73 6f 20 62 6f 6c 64 | 20 62 6f 72 64 65 72 20 |lso bold| border |
|00002670| 69 74 20 66 6f 72 20 79 | 6f 75 20 28 79 61 61 61 |it for y|ou (yaaa|
|00002680| 61 61 21 29 20 2a 2f 09 | 09 0d 70 61 73 63 61 6c |aa!) */.|..pascal|
|00002690| 20 4f 53 45 72 72 20 53 | 65 74 44 69 61 6c 6f 67 | OSErr S|etDialog|
|000026a0| 44 65 66 61 75 6c 74 49 | 74 65 6d 28 44 69 61 6c |DefaultI|tem(Dial|
|000026b0| 6f 67 50 74 72 20 74 68 | 65 44 69 61 6c 6f 67 2c |ogPtr th|eDialog,|
|000026c0| 20 73 68 6f 72 74 20 6e | 65 77 49 74 65 6d 29 20 | short n|ewItem) |
|000026d0| 0d 09 3d 20 7b 20 30 78 | 33 30 33 43 2c 20 30 78 |..= { 0x|303C, 0x|
|000026e0| 30 33 30 34 2c 20 30 78 | 41 41 36 38 20 7d 3b 09 |0304, 0x|AA68 };.|
|000026f0| 09 0d 2f 2a 20 49 6e 64 | 69 63 61 74 65 73 20 77 |../* Ind|icates w|
|00002700| 68 69 63 68 20 69 74 65 | 6d 20 73 68 6f 75 6c 64 |hich ite|m should|
|00002710| 20 62 65 20 61 6c 69 61 | 73 65 64 20 74 6f 20 65 | be alia|sed to e|
|00002720| 73 63 61 70 65 20 6f 72 | 20 43 6f 6d 6d 61 6e 64 |scape or| Command|
|00002730| 20 2d 20 2e 20 2a 2f 0d | 70 61 73 63 61 6c 20 4f | - . */.|pascal O|
|00002740| 53 45 72 72 20 53 65 74 | 44 69 61 6c 6f 67 43 61 |SErr Set|DialogCa|
|00002750| 6e 63 65 6c 49 74 65 6d | 28 44 69 61 6c 6f 67 50 |ncelItem|(DialogP|
|00002760| 74 72 20 74 68 65 44 69 | 61 6c 6f 67 2c 20 73 68 |tr theDi|alog, sh|
|00002770| 6f 72 74 20 6e 65 77 49 | 74 65 6d 29 0d 09 3d 20 |ort newI|tem)..= |
|00002780| 7b 20 30 78 33 30 33 43 | 2c 20 30 78 30 33 30 35 |{ 0x303C|, 0x0305|
|00002790| 2c 20 30 78 41 41 36 38 | 20 7d 3b 0d 2f 2a 20 54 |, 0xAA68| };./* T|
|000027a0| 65 6c 6c 73 20 74 68 65 | 20 44 69 61 6c 6f 67 20 |ells the| Dialog |
|000027b0| 4d 61 6e 61 67 65 72 20 | 74 68 61 74 20 74 68 65 |Manager |that the|
|000027c0| 72 65 20 69 73 20 61 6e | 20 65 64 69 74 20 6c 69 |re is an| edit li|
|000027d0| 6e 65 20 69 6e 20 74 68 | 69 73 20 64 69 61 6c 6f |ne in th|is dialo|
|000027e0| 67 2c 20 61 6e 64 20 69 | 74 20 73 68 6f 75 6c 64 |g, and i|t should|
|000027f0| 0d 2f 2a 20 74 72 61 63 | 6b 20 61 6e 64 20 63 68 |./* trac|k and ch|
|00002800| 61 6e 67 65 20 74 6f 20 | 61 6e 20 49 2d 42 65 61 |ange to |an I-Bea|
|00002810| 6d 20 63 75 72 73 6f 72 | 20 77 68 65 6e 20 6f 76 |m cursor| when ov|
|00002820| 65 72 20 74 68 65 20 65 | 64 69 74 20 6c 69 6e 65 |er the e|dit line|
|00002830| 20 2a 2f 0d 70 61 73 63 | 61 6c 20 4f 53 45 72 72 | */.pasc|al OSErr|
|00002840| 20 53 65 74 44 69 61 6c | 6f 67 54 72 61 63 6b 73 | SetDial|ogTracks|
|00002850| 43 75 72 73 6f 72 28 44 | 69 61 6c 6f 67 50 74 72 |Cursor(D|ialogPtr|
|00002860| 20 74 68 65 44 69 61 6c | 6f 67 2c 20 42 6f 6f 6c | theDial|og, Bool|
|00002870| 65 61 6e 20 74 72 61 63 | 6b 73 29 0d 09 3d 20 7b |ean trac|ks)..= {|
|00002880| 20 30 78 33 30 33 43 2c | 20 30 78 30 33 30 36 2c | 0x303C,| 0x0306,|
|00002890| 20 30 78 41 41 36 38 20 | 7d 3b 0d 2f 2a 20 54 68 | 0xAA68 |};./* Th|
|000028a0| 69 73 20 72 6f 75 74 69 | 6e 65 20 69 73 20 69 6e |is routi|ne is in|
|000028b0| 63 6c 75 64 65 64 20 69 | 6e 20 74 68 65 20 4d 50 |cluded i|n the MP|
|000028c0| 57 20 33 2e 32 20 49 6e | 74 65 72 66 61 63 65 2e |W 3.2 In|terface.|
|000028d0| 6f 20 6c 69 62 72 61 72 | 79 2c 20 61 6e 64 20 65 |o librar|y, and e|
|000028e0| 6c 69 6d 69 6e 61 74 65 | 73 20 74 68 65 0d 2f 2a |liminate|s the./*|
|000028f0| 20 6e 65 65 64 20 66 6f | 72 20 79 6f 75 20 74 6f | need fo|r you to|
|00002900| 20 68 61 76 65 20 74 6f | 20 64 69 73 70 61 74 63 | have to| dispatc|
|00002910| 68 20 74 6f 20 74 68 65 | 20 4d 6f 64 61 6c 46 69 |h to the| ModalFi|
|00002920| 6c 74 65 72 50 72 6f 63 | 50 74 72 20 72 65 74 75 |lterProc|Ptr retu|
|00002930| 72 6e 65 64 20 62 79 20 | 47 65 74 53 74 64 46 69 |rned by |GetStdFi|
|00002940| 6c 74 65 72 50 72 6f 63 | 20 2a 2f 0d 2f 2a 20 53 |lterProc| */./* S|
|00002950| 74 64 46 69 6c 74 65 72 | 50 72 6f 63 20 77 69 6c |tdFilter|Proc wil|
|00002960| 6c 20 63 61 6c 6c 20 47 | 65 74 53 74 64 46 69 6c |l call G|etStdFil|
|00002970| 74 65 72 50 72 6f 63 20 | 61 6e 64 20 64 69 73 70 |terProc |and disp|
|00002980| 61 74 63 68 20 74 6f 20 | 69 74 20 66 6f 72 20 79 |atch to |it for y|
|00002990| 6f 75 20 2a 2f 0d 70 61 | 73 63 61 6c 20 42 6f 6f |ou */.pa|scal Boo|
|000029a0| 6c 65 61 6e 20 53 74 64 | 46 69 6c 74 65 72 50 72 |lean Std|FilterPr|
|000029b0| 6f 63 28 44 69 61 6c 6f | 67 50 74 72 20 74 68 65 |oc(Dialo|gPtr the|
|000029c0| 44 69 61 6c 6f 67 2c 45 | 76 65 6e 74 52 65 63 6f |Dialog,E|ventReco|
|000029d0| 72 64 20 2a 74 68 65 45 | 76 65 6e 74 2c 73 68 6f |rd *theE|vent,sho|
|000029e0| 72 74 20 2a 69 74 65 6d | 48 69 74 29 3b 0d 4d 50 |rt *item|Hit);.MP|
|000029f0| 57 20 50 61 73 63 61 6c | 0d 7b 20 52 65 74 75 72 |W Pascal|.{ Retur|
|00002a00| 6e 73 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ns a poi|nter to |
|00002a10| 74 68 65 20 44 69 61 6c | 6f 67 20 4d 61 6e 61 67 |the Dial|og Manag|
|00002a20| 65 72 d5 73 20 73 74 61 | 6e 64 61 72 64 20 64 69 |er.s sta|ndard di|
|00002a30| 61 6c 6f 67 20 66 69 6c | 74 65 72 20 7d 0d 46 55 |alog fil|ter }.FU|
|00002a40| 4e 43 54 49 4f 4e 20 47 | 65 74 53 74 64 46 69 6c |NCTION G|etStdFil|
|00002a50| 74 65 72 50 72 6f 63 28 | 56 41 52 20 74 68 65 50 |terProc(|VAR theP|
|00002a60| 72 6f 63 3a 20 50 72 6f | 63 50 74 72 20 29 3a 20 |roc: Pro|cPtr ): |
|00002a70| 4f 53 45 72 72 3b 0d 09 | 49 4e 4c 49 4e 45 20 24 |OSErr;..|INLINE $|
|00002a80| 33 30 33 43 2c 20 24 30 | 32 30 33 2c 20 24 41 41 |303C, $0|203, $AA|
|00002a90| 36 38 3b 0d 7b 20 49 6e | 64 69 63 61 74 65 73 20 |68;.{ In|dicates |
|00002aa0| 74 6f 20 74 68 65 20 44 | 69 61 6c 6f 67 20 4d 61 |to the D|ialog Ma|
|00002ab0| 6e 61 67 65 72 20 77 68 | 69 63 68 20 69 74 65 6d |nager wh|ich item|
|00002ac0| 20 69 73 20 64 65 66 61 | 75 6c 74 2e 20 20 57 69 | is defa|ult. Wi|
|00002ad0| 6c 6c 20 74 68 65 6e 20 | 61 6c 69 61 73 20 74 68 |ll then |alias th|
|00002ae0| 65 20 72 65 74 75 72 6e | 20 26 20 7d 0d 7b 20 65 |e return| & }.{ e|
|00002af0| 6e 74 65 72 20 6b 65 79 | 20 7d 0d 7b 20 74 6f 20 |nter key| }.{ to |
|00002b00| 74 68 69 73 20 69 74 65 | 6d 2c 20 61 6e 64 20 61 |this ite|m, and a|
|00002b10| 6c 73 6f 20 62 6f 6c 64 | 20 62 6f 72 64 65 72 20 |lso bold| border |
|00002b20| 69 74 20 66 6f 72 20 79 | 6f 75 20 28 79 61 61 61 |it for y|ou (yaaa|
|00002b30| 61 61 21 29 20 7d 09 09 | 0d 46 55 4e 43 54 49 4f |aa!) }..|.FUNCTIO|
|00002b40| 4e 20 53 65 74 44 69 61 | 6c 6f 67 44 65 66 61 75 |N SetDia|logDefau|
|00002b50| 6c 74 49 74 65 6d 28 74 | 68 65 44 69 61 6c 6f 67 |ltItem(t|heDialog|
|00002b60| 3a 20 44 69 61 6c 6f 67 | 50 74 72 3b 20 6e 65 77 |: Dialog|Ptr; new|
|00002b70| 49 74 65 6d 3a 20 49 4e | 54 45 47 45 52 29 3a 20 |Item: IN|TEGER): |
|00002b80| 4f 53 45 72 72 3b 20 0d | 09 49 4e 4c 49 4e 45 20 |OSErr; .|.INLINE |
|00002b90| 24 33 30 33 43 2c 20 24 | 30 33 30 34 2c 20 24 41 |$303C, $|0304, $A|
|00002ba0| 41 36 38 3b 09 09 0d 7b | 20 49 6e 64 69 63 61 74 |A68;...{| Indicat|
|00002bb0| 65 73 20 77 68 69 63 68 | 20 69 74 65 6d 20 73 68 |es which| item sh|
|00002bc0| 6f 75 6c 64 20 62 65 20 | 61 6c 69 61 73 65 64 20 |ould be |aliased |
|00002bd0| 74 6f 20 65 73 63 61 70 | 65 20 6f 72 20 43 6f 6d |to escap|e or Com|
|00002be0| 6d 61 6e 64 20 2d 20 2e | 20 7d 0d 46 55 4e 43 54 |mand - .| }.FUNCT|
|00002bf0| 49 4f 4e 20 53 65 74 44 | 69 61 6c 6f 67 43 61 6e |ION SetD|ialogCan|
|00002c00| 63 65 6c 49 74 65 6d 28 | 74 68 65 44 69 61 6c 6f |celItem(|theDialo|
|00002c10| 67 3a 20 44 69 61 6c 6f | 67 50 74 72 3b 20 6e 65 |g: Dialo|gPtr; ne|
|00002c20| 77 49 74 65 6d 3a 20 49 | 4e 54 45 47 45 52 29 3a |wItem: I|NTEGER):|
|00002c30| 20 4f 53 45 72 72 3b 0d | 09 49 4e 4c 49 4e 45 20 | OSErr;.|.INLINE |
|00002c40| 24 33 30 33 43 2c 20 24 | 30 33 30 35 2c 20 24 41 |$303C, $|0305, $A|
|00002c50| 41 36 38 3b 0d 7b 20 54 | 65 6c 6c 73 20 74 68 65 |A68;.{ T|ells the|
|00002c60| 20 44 69 61 6c 6f 67 20 | 4d 61 6e 61 67 65 72 20 | Dialog |Manager |
|00002c70| 74 68 61 74 20 74 68 65 | 72 65 20 69 73 20 61 6e |that the|re is an|
|00002c80| 20 65 64 69 74 20 6c 69 | 6e 65 20 69 6e 20 74 68 | edit li|ne in th|
|00002c90| 69 73 20 64 69 61 6c 6f | 67 2c 20 61 6e 64 20 7d |is dialo|g, and }|
|00002ca0| 0d 7b 20 69 74 20 73 68 | 6f 75 6c 64 20 74 72 61 |.{ it sh|ould tra|
|00002cb0| 63 6b 20 61 6e 64 20 63 | 68 61 6e 67 65 20 74 6f |ck and c|hange to|
|00002cc0| 20 61 6e 20 49 2d 42 65 | 61 6d 20 63 75 72 73 6f | an I-Be|am curso|
|00002cd0| 72 20 77 68 65 6e 20 6f | 76 65 72 20 74 68 65 20 |r when o|ver the |
|00002ce0| 65 64 69 74 20 6c 69 6e | 65 20 7d 0d 46 55 4e 43 |edit lin|e }.FUNC|
|00002cf0| 54 49 4f 4e 20 53 65 74 | 44 69 61 6c 6f 67 54 72 |TION Set|DialogTr|
|00002d00| 61 63 6b 73 43 75 72 73 | 6f 72 28 74 68 65 44 69 |acksCurs|or(theDi|
|00002d10| 61 6c 6f 67 3a 20 44 69 | 61 6c 6f 67 50 74 72 3b |alog: Di|alogPtr;|
|00002d20| 20 74 72 61 63 6b 73 3a | 20 42 6f 6f 6c 65 61 6e | tracks:| Boolean|
|00002d30| 29 3a 4f 53 45 72 72 3b | 0d 09 49 4e 4c 49 4e 45 |):OSErr;|..INLINE|
|00002d40| 20 24 33 30 33 43 2c 20 | 24 30 33 30 36 2c 20 24 | $303C, |$0306, $|
|00002d50| 41 41 36 38 20 3b 0d 7b | 20 54 68 69 73 20 72 6f |AA68 ;.{| This ro|
|00002d60| 75 74 69 6e 65 20 69 73 | 20 69 6e 63 6c 75 64 65 |utine is| include|
|00002d70| 64 20 69 6e 20 74 68 65 | 20 4d 50 57 20 33 2e 32 |d in the| MPW 3.2|
|00002d80| 20 49 6e 74 65 72 66 61 | 63 65 2e 6f 20 6c 69 62 | Interfa|ce.o lib|
|00002d90| 72 61 72 79 2c 20 61 6e | 64 20 65 6c 69 6d 69 6e |rary, an|d elimin|
|00002da0| 61 74 65 73 20 74 68 65 | 20 7d 0d 7b 20 6e 65 65 |ates the| }.{ nee|
|00002db0| 64 20 66 6f 72 20 79 6f | 75 20 74 6f 20 68 61 76 |d for yo|u to hav|
|00002dc0| 65 20 74 6f 20 64 69 73 | 70 61 74 63 68 20 74 6f |e to dis|patch to|
|00002dd0| 20 74 68 65 20 4d 6f 64 | 61 6c 46 69 6c 74 65 72 | the Mod|alFilter|
|00002de0| 50 72 6f 63 50 74 72 20 | 72 65 74 75 72 6e 65 64 |ProcPtr |returned|
|00002df0| 20 62 79 20 47 65 74 53 | 74 64 46 69 6c 74 65 72 | by GetS|tdFilter|
|00002e00| 50 72 6f 63 20 7d 0d 7b | 20 53 74 64 46 69 6c 74 |Proc }.{| StdFilt|
|00002e10| 65 72 50 72 6f 63 20 77 | 69 6c 6c 20 63 61 6c 6c |erProc w|ill call|
|00002e20| 20 47 65 74 53 74 64 46 | 69 6c 74 65 72 50 72 6f | GetStdF|ilterPro|
|00002e30| 63 20 61 6e 64 20 64 69 | 73 70 61 74 63 68 20 74 |c and di|spatch t|
|00002e40| 6f 20 69 74 20 66 6f 72 | 20 79 6f 75 20 7d 0d 46 |o it for| you }.F|
|00002e50| 55 4e 43 54 49 4f 4e 20 | 53 74 64 46 69 6c 74 65 |UNCTION |StdFilte|
|00002e60| 72 50 72 6f 63 28 74 68 | 65 44 69 61 6c 6f 67 3a |rProc(th|eDialog:|
|00002e70| 20 44 69 61 6c 6f 67 50 | 74 72 3b 20 56 41 52 20 | DialogP|tr; VAR |
|00002e80| 65 76 65 6e 74 3a 20 45 | 76 65 6e 74 52 65 63 6f |event: E|ventReco|
|00002e90| 72 64 3b 20 56 41 52 20 | 69 74 65 6d 48 69 74 3a |rd; VAR |itemHit:|
|00002ea0| 20 49 4e 54 45 47 45 52 | 29 3a 20 42 4f 4f 4c 45 | INTEGER|): BOOLE|
|00002eb0| 41 4e 3b 0d 4d 50 57 20 | 41 73 73 65 6d 62 6c 79 |AN;.MPW |Assembly|
|00002ec0| 0d 73 65 6c 65 63 74 47 | 65 74 53 74 64 46 69 6c |.selectG|etStdFil|
|00002ed0| 74 65 72 50 72 6f 63 09 | 09 09 45 51 55 09 09 09 |terProc.|..EQU...|
|00002ee0| 33 0d 70 61 72 61 6d 57 | 6f 72 64 73 47 65 74 53 |3.paramW|ordsGetS|
|00002ef0| 74 64 46 69 6c 74 65 72 | 50 72 6f 63 09 09 09 45 |tdFilter|Proc...E|
|00002f00| 51 55 09 09 09 32 0d 73 | 65 6c 65 63 74 53 65 74 |QU...2.s|electSet|
|00002f10| 44 69 61 6c 6f 67 44 65 | 66 61 75 6c 74 49 74 65 |DialogDe|faultIte|
|00002f20| 6d 09 09 09 45 51 55 09 | 09 09 34 0d 70 61 72 61 |m...EQU.|..4.para|
|00002f30| 6d 57 6f 72 64 73 53 65 | 74 44 69 61 6c 6f 67 44 |mWordsSe|tDialogD|
|00002f40| 65 66 61 75 6c 74 49 74 | 65 6d 09 09 45 51 55 09 |efaultIt|em..EQU.|
|00002f50| 09 09 33 0d 73 65 6c 65 | 63 74 53 65 74 44 69 61 |..3.sele|ctSetDia|
|00002f60| 6c 6f 67 43 61 6e 63 65 | 6c 49 74 65 6d 09 09 09 |logCance|lItem...|
|00002f70| 45 51 55 09 09 09 35 0d | 70 61 72 61 6d 57 6f 72 |EQU...5.|paramWor|
|00002f80| 64 73 53 65 74 44 69 61 | 6c 6f 67 43 61 6e 63 65 |dsSetDia|logCance|
|00002f90| 6c 49 74 65 6d 09 09 45 | 51 55 09 09 09 33 0d 73 |lItem..E|QU...3.s|
|00002fa0| 65 6c 65 63 74 53 65 74 | 44 69 61 6c 6f 67 54 72 |electSet|DialogTr|
|00002fb0| 61 63 6b 73 43 75 72 73 | 6f 72 09 09 09 45 51 55 |acksCurs|or...EQU|
|00002fc0| 09 09 09 36 0d 70 61 72 | 61 6d 57 6f 72 64 73 53 |...6.par|amWordsS|
|00002fd0| 65 74 44 69 61 6c 6f 67 | 54 72 61 63 6b 73 43 75 |etDialog|TracksCu|
|00002fe0| 72 73 6f 72 09 09 45 51 | 55 09 09 09 33 0d 5f 44 |rsor..EQ|U...3._D|
|00002ff0| 69 61 6c 6f 67 44 69 73 | 70 61 74 63 68 09 4f 50 |ialogDis|patch.OP|
|00003000| 57 4f 52 44 20 20 09 24 | 41 41 36 38 0d 09 09 4d |WORD .$|AA68...M|
|00003010| 41 43 52 4f 0d 09 09 44 | 6f 44 69 61 6c 6f 67 4d |ACRO...D|oDialogM|
|00003020| 67 72 44 69 73 70 61 74 | 63 68 20 26 72 6f 75 74 |grDispat|ch &rout|
|00003030| 69 6e 65 4e 61 6d 65 0d | 09 09 44 6f 44 69 73 70 |ineName.|..DoDisp|
|00003040| 61 74 63 68 20 5f 44 69 | 61 6c 6f 67 44 69 73 70 |atch _Di|alogDisp|
|00003050| 61 74 63 68 2c 73 65 6c | 65 63 74 26 72 6f 75 74 |atch,sel|ect&rout|
|00003060| 69 6e 65 4e 61 6d 65 2c | 70 61 72 61 6d 57 6f 72 |ineName,|paramWor|
|00003070| 64 73 26 72 6f 75 74 69 | 6e 65 4e 61 6d 65 0d 09 |ds&routi|neName..|
|00003080| 09 45 4e 44 4d 0d 3b 20 | 52 65 74 75 72 6e 73 20 |.ENDM.; |Returns |
|00003090| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the|
|000030a0| 20 44 69 61 6c 6f 67 20 | 4d 61 6e 61 67 65 72 d5 | Dialog |Manager.|
|000030b0| 73 20 73 74 61 6e 64 61 | 72 64 20 64 69 61 6c 6f |s standa|rd dialo|
|000030c0| 67 20 66 69 6c 74 65 72 | 20 0d 3b 20 46 55 4e 43 |g filter| .; FUNC|
|000030d0| 54 49 4f 4e 20 47 65 74 | 53 74 64 46 69 6c 74 65 |TION Get|StdFilte|
|000030e0| 72 50 72 6f 63 28 56 41 | 52 20 74 68 65 50 72 6f |rProc(VA|R thePro|
|000030f0| 63 3a 20 50 72 6f 63 50 | 74 72 29 3a 20 4f 53 45 |c: ProcP|tr): OSE|
|00003100| 72 72 3b 0d 3b 0d 09 09 | 4d 41 43 52 4f 0d 09 09 |rr;.;...|MACRO...|
|00003110| 5f 47 65 74 53 74 64 46 | 69 6c 74 65 72 50 72 6f |_GetStdF|ilterPro|
|00003120| 63 0d 09 09 44 6f 44 69 | 61 6c 6f 67 4d 67 72 44 |c...DoDi|alogMgrD|
|00003130| 69 73 70 61 74 63 68 20 | 47 65 74 53 74 64 46 69 |ispatch |GetStdFi|
|00003140| 6c 74 65 72 50 72 6f 63 | 0d 09 09 45 4e 44 4d 0d |lterProc|...ENDM.|
|00003150| 3b 20 49 6e 64 69 63 61 | 74 65 73 20 74 6f 20 74 |; Indica|tes to t|
|00003160| 68 65 20 44 69 61 6c 6f | 67 20 4d 61 6e 61 67 65 |he Dialo|g Manage|
|00003170| 72 20 77 68 69 63 68 20 | 69 74 65 6d 20 69 73 20 |r which |item is |
|00003180| 64 65 66 61 75 6c 74 2e | 20 20 57 69 6c 6c 20 74 |default.| Will t|
|00003190| 68 65 6e 20 61 6c 69 61 | 73 20 74 68 65 20 72 65 |hen alia|s the re|
|000031a0| 74 75 72 6e 20 3b 20 6b | 65 79 20 26 20 65 6e 74 |turn ; k|ey & ent|
|000031b0| 65 72 20 6b 65 79 20 74 | 6f 20 74 68 69 73 20 69 |er key t|o this i|
|000031c0| 74 65 6d 2c 20 61 6e 64 | 20 61 6c 73 6f 20 62 6f |tem, and| also bo|
|000031d0| 6c 64 20 62 6f 72 64 65 | 72 20 69 74 20 66 6f 72 |ld borde|r it for|
|000031e0| 20 79 6f 75 20 28 79 61 | 61 61 61 61 21 29 20 0d | you (ya|aaaa!) .|
|000031f0| 3b 20 46 55 4e 43 54 49 | 4f 4e 20 53 65 74 44 69 |; FUNCTI|ON SetDi|
|00003200| 61 6c 6f 67 44 65 66 61 | 75 6c 74 49 74 65 6d 28 |alogDefa|ultItem(|
|00003210| 74 68 65 44 69 61 6c 6f | 67 3a 20 44 69 61 6c 6f |theDialo|g: Dialo|
|00003220| 67 50 74 72 3b 20 6e 65 | 77 49 74 65 6d 3a 20 49 |gPtr; ne|wItem: I|
|00003230| 4e 54 45 47 45 52 29 3a | 20 4f 53 45 72 72 3b 0d |NTEGER):| OSErr;.|
|00003240| 3b 0d 09 09 4d 41 43 52 | 4f 0d 09 09 5f 53 65 74 |;...MACR|O..._Set|
|00003250| 44 69 61 6c 6f 67 44 65 | 66 61 75 6c 74 49 74 65 |DialogDe|faultIte|
|00003260| 6d 0d 09 09 44 6f 44 69 | 61 6c 6f 67 4d 67 72 44 |m...DoDi|alogMgrD|
|00003270| 69 73 70 61 74 63 68 20 | 53 65 74 44 69 61 6c 6f |ispatch |SetDialo|
|00003280| 67 44 65 66 61 75 6c 74 | 49 74 65 6d 0d 09 09 45 |gDefault|Item...E|
|00003290| 4e 44 4d 0d 3b 20 49 6e | 64 69 63 61 74 65 73 20 |NDM.; In|dicates |
|000032a0| 77 68 69 63 68 20 69 74 | 65 6d 20 73 68 6f 75 6c |which it|em shoul|
|000032b0| 64 20 62 65 20 61 6c 69 | 61 73 65 64 20 74 6f 20 |d be ali|ased to |
|000032c0| 65 73 63 61 70 65 20 6f | 72 20 43 6f 6d 6d 61 6e |escape o|r Comman|
|000032d0| 64 20 2d 20 2e 0d 3b 20 | 46 55 4e 43 54 49 4f 4e |d - ..; |FUNCTION|
|000032e0| 20 53 65 74 44 69 61 6c | 6f 67 43 61 6e 63 65 6c | SetDial|ogCancel|
|000032f0| 49 74 65 6d 28 74 68 65 | 44 69 61 6c 6f 67 3a 20 |Item(the|Dialog: |
|00003300| 44 69 61 6c 6f 67 50 74 | 72 3b 20 6e 65 77 49 74 |DialogPt|r; newIt|
|00003310| 65 6d 3a 20 49 4e 54 45 | 47 45 52 29 3a 20 4f 53 |em: INTE|GER): OS|
|00003320| 45 72 72 3b 0d 3b 0d 09 | 09 4d 41 43 52 4f 0d 09 |Err;.;..|.MACRO..|
|00003330| 09 5f 53 65 74 44 69 61 | 6c 6f 67 43 61 6e 63 65 |._SetDia|logCance|
|00003340| 6c 49 74 65 6d 0d 09 09 | 44 6f 44 69 61 6c 6f 67 |lItem...|DoDialog|
|00003350| 4d 67 72 44 69 73 70 61 | 74 63 68 20 53 65 74 44 |MgrDispa|tch SetD|
|00003360| 69 61 6c 6f 67 43 61 6e | 63 65 6c 49 74 65 6d 0d |ialogCan|celItem.|
|00003370| 09 09 45 4e 44 4d 0d 3b | 20 54 65 6c 6c 73 20 74 |..ENDM.;| Tells t|
|00003380| 68 65 20 44 69 61 6c 6f | 67 20 4d 61 6e 61 67 65 |he Dialo|g Manage|
|00003390| 72 20 74 68 61 74 20 74 | 68 65 72 65 20 69 73 20 |r that t|here is |
|000033a0| 61 6e 20 65 64 69 74 20 | 6c 69 6e 65 20 69 6e 20 |an edit |line in |
|000033b0| 74 68 69 73 20 64 69 61 | 6c 6f 67 2c 20 61 6e 64 |this dia|log, and|
|000033c0| 20 0d 3b 20 69 74 20 73 | 68 6f 75 6c 64 20 74 72 | .; it s|hould tr|
|000033d0| 61 63 6b 20 61 6e 64 20 | 63 68 61 6e 67 65 20 74 |ack and |change t|
|000033e0| 6f 20 61 6e 20 49 2d 42 | 65 61 6d 20 63 75 72 73 |o an I-B|eam curs|
|000033f0| 6f 72 20 77 68 65 6e 20 | 6f 76 65 72 20 74 68 65 |or when |over the|
|00003400| 20 65 64 69 74 20 6c 69 | 6e 65 20 0d 3b 20 46 55 | edit li|ne .; FU|
|00003410| 4e 43 54 49 4f 4e 20 53 | 65 74 44 69 61 6c 6f 67 |NCTION S|etDialog|
|00003420| 54 72 61 63 6b 73 43 75 | 72 73 6f 72 28 74 68 65 |TracksCu|rsor(the|
|00003430| 44 69 61 6c 6f 67 3a 20 | 44 69 61 6c 6f 67 50 74 |Dialog: |DialogPt|
|00003440| 72 3b 20 74 72 61 63 6b | 73 3a 20 42 6f 6f 6c 65 |r; track|s: Boole|
|00003450| 61 6e 29 3a 20 4f 53 45 | 72 72 3b 0d 09 09 4d 41 |an): OSE|rr;...MA|
|00003460| 43 52 4f 0d 09 09 5f 53 | 65 74 44 69 61 6c 6f 67 |CRO..._S|etDialog|
|00003470| 54 72 61 63 6b 73 43 75 | 72 73 6f 72 0d 09 09 44 |TracksCu|rsor...D|
|00003480| 6f 44 69 61 6c 6f 67 4d | 67 72 44 69 73 70 61 74 |oDialogM|grDispat|
|00003490| 63 68 20 53 65 74 44 69 | 61 6c 6f 67 54 72 61 63 |ch SetDi|alogTrac|
|000034a0| 6b 73 43 75 72 73 6f 72 | 0d 09 09 45 4e 44 4d 0d |ksCursor|...ENDM.|
|000034b0| 55 73 69 6e 67 20 74 68 | 65 73 65 20 63 61 6c 6c |Using th|ese call|
|000034c0| 73 20 72 65 71 75 69 72 | 65 73 20 61 20 6c 69 74 |s requir|es a lit|
|000034d0| 74 6c 65 20 70 72 65 70 | 61 72 61 74 69 6f 6e 20 |tle prep|aration |
|000034e0| 6f 6e 20 79 6f 75 72 20 | 70 61 72 74 2e 20 20 41 |on your |part. A|
|000034f0| 66 74 65 72 20 79 6f 75 | 20 63 72 65 61 74 65 20 |fter you| create |
|00003500| 79 6f 75 72 20 64 69 61 | 6c 6f 67 2c 20 79 6f 75 |your dia|log, you|
|00003510| 20 6e 65 65 64 20 74 6f | 20 74 65 6c 6c 20 74 68 | need to| tell th|
|00003520| 65 20 44 69 61 6c 6f 67 | 20 4d 61 6e 61 67 65 72 |e Dialog| Manager|
|00003530| 20 77 68 69 63 68 20 69 | 74 65 6d 73 20 79 6f 75 | which i|tems you|
|00003540| 20 77 61 6e 74 20 61 73 | 20 74 68 65 20 64 65 66 | want as| the def|
|00003550| 61 75 6c 74 20 61 6e 64 | 20 63 61 6e 63 65 6c 20 |ault and| cancel |
|00003560| 69 74 65 6d 73 2e 20 20 | 54 68 65 20 62 75 74 74 |items. |The butt|
|00003570| 6f 6e 20 73 65 6c 65 63 | 74 65 64 20 61 73 20 74 |on selec|ted as t|
|00003580| 68 65 20 63 61 6e 63 65 | 6c 20 69 74 65 6d 20 77 |he cance|l item w|
|00003590| 69 6c 6c 20 62 65 20 74 | 6f 67 67 6c 65 64 20 62 |ill be t|oggled b|
|000035a0| 79 20 74 68 65 20 45 73 | 63 61 70 65 20 6b 65 79 |y the Es|cape key|
|000035b0| 20 6f 72 20 62 79 20 61 | 20 43 6f 6d 6d 61 6e 64 | or by a| Command|
|000035c0| 2d 2e 20 6b 65 79 70 72 | 65 73 73 2e 20 20 54 68 |-. keypr|ess. Th|
|000035d0| 65 20 62 75 74 74 6f 6e | 20 73 70 65 63 69 66 69 |e button| specifi|
|000035e0| 65 64 20 61 73 20 74 68 | 65 20 64 65 66 61 75 6c |ed as th|e defaul|
|000035f0| 74 20 77 69 6c 6c 20 62 | 65 20 74 6f 67 67 6c 65 |t will b|e toggle|
|00003600| 64 20 62 79 20 74 68 65 | 20 72 65 74 75 72 6e 20 |d by the| return |
|00003610| 6f 72 20 65 6e 74 65 72 | 20 6b 65 79 2c 20 61 6e |or enter| key, an|
|00003620| 64 20 61 6c 73 6f 20 77 | 69 6c 6c 20 68 61 76 65 |d also w|ill have|
|00003630| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 68 65 | the sta|ndard he|
|00003640| 61 76 79 20 62 6c 61 63 | 6b 20 62 6f 72 64 65 72 |avy blac|k border|
|00003650| 20 64 72 61 77 6e 20 61 | 72 6f 75 6e 64 20 69 74 | drawn a|round it|
|00003660| 21 20 20 54 68 65 20 62 | 75 74 74 6f 6e 73 20 77 |! The b|uttons w|
|00003670| 69 6c 6c 20 61 6c 73 6f | 20 62 65 20 68 69 6c 69 |ill also| be hili|
|00003680| 74 65 64 20 77 68 65 6e | 20 74 68 65 20 63 6f 72 |ted when| the cor|
|00003690| 72 65 63 74 20 6b 65 79 | 20 69 73 20 68 69 74 2e |rect key| is hit.|
|000036a0| 0d 54 68 65 20 53 65 74 | 44 69 61 6c 6f 67 54 72 |.The Set|DialogTr|
|000036b0| 61 63 6b 73 43 75 72 73 | 6f 72 20 63 61 6c 6c 20 |acksCurs|or call |
|000036c0| 74 65 6c 6c 73 20 74 68 | 65 20 44 69 61 6c 6f 67 |tells th|e Dialog|
|000036d0| 20 4d 61 6e 61 67 65 72 | 20 74 68 61 74 20 79 6f | Manager| that yo|
|000036e0| 75 20 68 61 76 65 20 65 | 64 69 74 20 6c 69 6e 65 |u have e|dit line|
|000036f0| 73 20 69 6e 20 79 6f 75 | 72 20 64 69 61 6c 6f 67 |s in you|r dialog|
|00003700| 2e 20 20 57 68 65 6e 20 | 79 6f 75 20 70 61 73 73 |. When |you pass|
|00003710| 20 61 20 d4 74 72 75 65 | d5 20 76 61 6c 75 65 20 | a .true|. value |
|00003720| 74 6f 20 74 68 65 20 53 | 65 74 44 69 61 6c 6f 67 |to the S|etDialog|
|00003730| 54 72 61 63 6b 73 43 75 | 72 73 6f 72 20 20 63 61 |TracksCu|rsor ca|
|00003740| 6c 6c 20 74 68 65 20 44 | 69 61 6c 6f 67 20 4d 61 |ll the D|ialog Ma|
|00003750| 6e 61 67 65 72 20 77 69 | 6c 6c 20 63 6f 6e 73 74 |nager wi|ll const|
|00003760| 61 6e 74 6c 79 20 63 68 | 65 63 6b 20 63 75 72 73 |antly ch|eck curs|
|00003770| 6f 72 20 70 6f 73 69 74 | 69 6f 6e 20 69 6e 20 79 |or posit|ion in y|
|00003780| 6f 75 72 20 64 69 61 6c | 6f 67 2c 20 61 6e 64 20 |our dial|og, and |
|00003790| 63 68 61 6e 67 65 20 74 | 68 65 20 63 75 72 73 6f |change t|he curso|
|000037a0| 72 20 74 6f 20 61 6e 20 | 49 2d 42 65 61 6d 20 77 |r to an |I-Beam w|
|000037b0| 68 65 6e 20 74 68 65 20 | 63 75 72 73 6f 72 20 69 |hen the |cursor i|
|000037c0| 73 20 6f 76 65 72 20 61 | 6e 20 65 64 69 74 20 6c |s over a|n edit l|
|000037d0| 69 6e 65 2e 0d 53 6f 20 | 74 68 65 20 63 6f 6d 70 |ine..So |the comp|
|000037e0| 6c 65 74 65 20 53 79 73 | 74 65 6d 20 37 20 66 69 |lete Sys|tem 7 fi|
|000037f0| 6c 74 65 72 2c 20 69 6e | 63 6f 72 70 6f 72 61 74 |lter, in|corporat|
|00003800| 69 6e 67 20 75 70 64 61 | 74 65 20 68 61 6e 64 6c |ing upda|te handl|
|00003810| 69 6e 67 20 61 6e 64 20 | 6e 65 77 20 44 69 61 6c |ing and |new Dial|
|00003820| 6f 67 20 4d 61 6e 61 67 | 65 72 20 63 61 6c 6c 73 |og Manag|er calls|
|00003830| 2c 20 77 69 6c 6c 20 6c | 6f 6f 6b 20 73 6f 6d 65 |, will l|ook some|
|00003840| 74 68 69 6e 67 20 6c 69 | 6b 65 20 74 68 69 73 3b |thing li|ke this;|
|00003850| 0d 4d 50 57 20 43 0d 2f | 2a 20 42 65 66 6f 72 65 |.MPW C./|* Before|
|00003860| 20 77 65 20 67 6f 20 69 | 6e 74 6f 20 61 20 4d 6f | we go i|nto a Mo|
|00003870| 64 61 6c 44 69 61 6c 6f | 67 20 6c 6f 6f 70 2c 20 |dalDialo|g loop, |
|00003880| 64 6f 20 61 20 6c 69 74 | 74 6c 65 20 70 72 65 70 |do a lit|tle prep|
|00003890| 61 72 61 74 69 6f 6e 20 | 2a 2f 20 0d 6d 79 44 69 |aration |*/ .myDi|
|000038a0| 61 6c 6f 67 50 74 72 20 | 3d 20 47 65 74 4e 65 77 |alogPtr |= GetNew|
|000038b0| 44 69 61 6c 6f 67 28 6b | 4d 79 44 69 61 6c 6f 67 |Dialog(k|MyDialog|
|000038c0| 49 44 2c 20 6e 69 6c 2c | 20 28 57 69 6e 64 6f 77 |ID, nil,| (Window|
|000038d0| 50 74 72 29 2d 31 29 3b | 0d 6d 79 45 72 72 20 3d |Ptr)-1);|.myErr =|
|000038e0| 20 53 65 74 44 69 61 6c | 6f 67 44 65 66 61 75 6c | SetDial|ogDefaul|
|000038f0| 74 49 74 65 6d 28 6d 79 | 44 69 61 6c 6f 67 50 74 |tItem(my|DialogPt|
|00003900| 72 2c 6f 6b 29 3b 09 2f | 2a 20 54 65 6c 6c 20 74 |r,ok);./|* Tell t|
|00003910| 68 65 20 44 69 61 6c 6f | 67 20 4d 61 6e 61 67 65 |he Dialo|g Manage|
|00003920| 72 20 74 68 61 74 20 09 | 2f 2a 20 74 68 65 20 4f |r that .|/* the O|
|00003930| 4b 20 62 75 74 74 6f 6e | 20 69 73 20 74 68 65 20 |K button| is the |
|00003940| 64 65 66 61 75 6c 74 20 | 2a 2f 0d 6d 79 45 72 72 |default |*/.myErr|
|00003950| 20 3d 20 53 65 74 44 69 | 61 6c 6f 67 43 61 6e 63 | = SetDi|alogCanc|
|00003960| 65 6c 49 74 65 6d 28 6d | 79 44 69 61 6c 6f 67 50 |elItem(m|yDialogP|
|00003970| 74 72 2c 63 61 6e 63 65 | 6c 29 3b 09 2f 2a 20 54 |tr,cance|l);./* T|
|00003980| 65 6c 6c 20 74 68 65 20 | 44 69 61 6c 6f 67 20 4d |ell the |Dialog M|
|00003990| 61 6e 61 67 65 72 20 74 | 68 65 20 09 09 09 09 09 |anager t|he .....|
|000039a0| 09 09 2f 2a 20 63 61 6e | 63 65 6c 20 62 75 74 74 |../* can|cel butt|
|000039b0| 6f 6e 20 69 73 20 74 68 | 65 20 63 61 6e 63 65 6c |on is th|e cancel|
|000039c0| 20 09 09 09 09 09 09 09 | 2f 2a 20 69 74 65 6d 2a | .......|/* item*|
|000039d0| 2f 0d 6d 79 45 72 72 20 | 3d 20 53 65 74 44 69 61 |/.myErr |= SetDia|
|000039e0| 6c 6f 67 54 72 61 63 6b | 73 43 75 72 73 6f 72 28 |logTrack|sCursor(|
|000039f0| 6d 79 44 69 61 6c 6f 67 | 50 74 72 2c 74 72 75 65 |myDialog|Ptr,true|
|00003a00| 29 3b 09 2f 2a 20 57 65 | 20 68 61 76 65 20 61 6e |);./* We| have an|
|00003a10| 20 65 64 69 74 20 69 74 | 65 6d 20 69 6e 20 6f 75 | edit it|em in ou|
|00003a20| 72 20 09 2f 2a 20 64 69 | 61 6c 6f 67 2c 73 6f 20 |r ./* di|alog,so |
|00003a30| 74 65 6c 6c 20 74 68 65 | 20 44 69 61 6c 6f 67 20 |tell the| Dialog |
|00003a40| 09 2f 2a 20 4d 61 6e 61 | 67 65 72 20 74 6f 20 63 |./* Mana|ger to c|
|00003a50| 68 61 6e 67 65 20 74 68 | 65 20 63 75 72 73 6f 72 |hange th|e cursor|
|00003a60| 20 74 6f 20 09 2f 2a 20 | 61 6e 20 49 2d 42 65 61 | to ./* |an I-Bea|
|00003a70| 6d 20 77 68 65 6e 20 69 | 74 d5 73 20 6f 76 65 72 |m when i|t.s over|
|00003a80| 20 74 68 65 20 09 2f 2a | 20 65 64 69 74 20 6c 69 | the ./*| edit li|
|00003a90| 6e 65 20 2a 2f 0d 64 6f | 20 7b 0d 20 20 20 20 4d |ne */.do| {. M|
|00003aa0| 6f 64 61 6c 44 69 61 6c | 6f 67 28 28 4d 6f 64 61 |odalDial|og((Moda|
|00003ab0| 6c 46 69 6c 74 65 72 50 | 72 6f 63 50 74 72 29 6d |lFilterP|rocPtr)m|
|00003ac0| 79 46 69 6c 74 65 72 2c | 20 26 68 69 74 49 74 65 |yFilter,| &hitIte|
|00003ad0| 6d 29 3b 0d 20 20 20 20 | 7d 77 68 69 6c 65 28 68 |m);. |}while(h|
|00003ae0| 69 74 49 74 65 6d 20 21 | 3d 20 6f 6b 20 26 26 20 |itItem !|= ok && |
|00003af0| 68 69 74 49 74 65 6d 20 | 21 3d 63 61 6e 63 65 6c |hitItem |!=cancel|
|00003b00| 29 3b 0d 2f 2a 20 61 6e | 64 20 79 6f 75 72 20 66 |);./* an|d your f|
|00003b10| 69 6c 74 65 72 20 77 69 | 6c 6c 20 6c 6f 6f 6b 20 |ilter wi|ll look |
|00003b20| 73 6f 6d 65 74 68 69 6e | 67 20 6c 69 6b 65 20 74 |somethin|g like t|
|00003b30| 68 69 73 20 2a 2f 0d 70 | 61 73 63 61 6c 20 42 6f |his */.p|ascal Bo|
|00003b40| 6f 6c 65 61 6e 20 6d 79 | 46 69 6c 74 65 72 28 44 |olean my|Filter(D|
|00003b50| 69 61 6c 6f 67 50 74 72 | 20 63 75 72 72 65 6e 74 |ialogPtr| current|
|00003b60| 44 69 61 6c 6f 67 2c 20 | 45 76 65 6e 74 52 65 63 |Dialog, |EventRec|
|00003b70| 6f 72 64 20 2a 74 68 65 | 45 76 65 6e 74 49 6e 2c |ord *the|EventIn,|
|00003b80| 20 73 68 6f 72 74 20 2a | 74 68 65 44 69 61 6c 6f | short *|theDialo|
|00003b90| 67 49 74 65 6d 29 0d 7b | 4f 53 45 72 72 20 6d 79 |gItem).{|OSErr my|
|00003ba0| 45 72 72 3b 0d 4d 6f 64 | 61 6c 46 69 6c 74 65 72 |Err;.Mod|alFilter|
|00003bb0| 50 72 6f 63 50 74 72 20 | 73 74 61 6e 64 61 72 64 |ProcPtr |standard|
|00003bc0| 50 72 6f 63 3b 0d 42 6f | 6f 6c 65 61 6e 20 72 65 |Proc;.Bo|olean re|
|00003bd0| 74 75 72 6e 56 61 6c 20 | 3d 20 66 61 6c 73 65 3b |turnVal |= false;|
|00003be0| 0d 57 69 6e 64 6f 77 50 | 74 72 20 74 65 6d 70 3b |.WindowP|tr temp;|
|00003bf0| 0d 69 66 28 74 68 65 45 | 76 65 6e 74 49 6e 2d 3e |.if(theE|ventIn->|
|00003c00| 77 68 61 74 20 3d 3d 20 | 75 70 64 61 74 65 45 76 |what == |updateEv|
|00003c10| 74 20 26 26 20 20 74 68 | 65 45 76 65 6e 74 49 6e |t && th|eEventIn|
|00003c20| 2d 3e 6d 65 73 73 61 67 | 65 20 21 3d 20 63 75 72 |->messag|e != cur|
|00003c30| 72 65 6e 74 44 69 61 6c | 6f 67 29 20 7b 0d 20 20 |rentDial|og) {. |
|00003c40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003c90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 20 | | /* |
|00003ca0| 69 66 20 74 68 65 20 75 | 70 64 61 74 65 20 69 73 |if the u|pdate is|
|00003cb0| 20 66 6f 72 20 74 68 65 | 20 64 69 61 6c 6f 67 20 | for the| dialog |
|00003cc0| 62 6f 78 2c 20 69 67 6e | 6f 72 65 20 09 09 09 09 |box, ign|ore ....|
|00003cd0| 09 20 20 2f 2a 20 69 74 | 20 2a 2f 0d 20 20 20 20 |. /* it| */. |
|00003ce0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d00| 20 20 2f 2a 20 73 69 6e | 63 65 20 74 68 65 20 72 | /* sin|ce the r|
|00003d10| 65 67 75 6c 61 72 20 4d | 6f 64 61 6c 44 69 61 6c |egular M|odalDial|
|00003d20| 6f 67 20 66 75 6e 63 74 | 69 6f 6e 0d 20 20 20 20 |og funct|ion. |
|00003d30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003d80| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 77 69 | | /* wi|
|00003d90| 6c 6c 20 20 72 65 64 72 | 61 77 20 69 74 20 61 73 |ll redr|aw it as|
|00003da0| 20 6e 65 63 65 73 73 61 | 72 79 20 2a 2f 09 0d 20 | necessa|ry */.. |
|00003db0| 09 72 65 74 75 72 6e 56 | 61 6c 20 3d 20 4d 79 44 |.returnV|al = MyD|
|00003dc0| 72 61 77 50 72 6f 63 28 | 74 68 65 45 76 65 6e 74 |rawProc(|theEvent|
|00003dd0| 49 6e 2d 3e 6d 65 73 73 | 61 67 65 29 3b 20 2f 2a |In->mess|age); /*|
|00003de0| 20 67 6f 20 74 6f 20 6d | 79 20 64 72 61 77 69 6e | go to m|y drawin|
|00003df0| 67 20 72 6f 75 74 69 6e | 65 20 2a 2f 20 20 0d 20 |g routin|e */ . |
|00003e00| 20 20 20 7d 20 65 6c 73 | 65 20 7b 20 0d 20 20 20 | } els|e { . |
|00003e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e30| 20 20 20 2f 2a 20 69 74 | 20 77 61 73 6e d5 74 20 | /* it| wasn.t |
|00003e40| 61 6e 20 75 70 64 61 74 | 65 2c 20 70 61 73 73 20 |an updat|e, pass |
|00003e50| 69 74 20 6f 6e 20 74 6f | 20 74 68 65 20 2a 2f 0d |it on to| the */.|
|00003e60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e80| 20 20 20 20 20 20 2f 2a | 20 73 79 73 74 65 6d 20 | /*| system |
|00003e90| 66 69 6c 74 65 72 20 2a | 2f 0d 09 47 65 74 50 6f |filter *|/..GetPo|
|00003ea0| 72 74 28 26 74 65 6d 70 | 29 3b 20 20 20 20 20 20 |rt(&temp|); |
|00003eb0| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 73 61 76 | | /* sav|
|00003ec0| 65 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 70 6f |e the cu|rrent po|
|00003ed0| 72 74 20 2a 2f 0d 09 53 | 65 74 50 6f 72 74 28 63 |rt */..S|etPort(c|
|00003ee0| 75 72 72 65 6e 74 44 69 | 61 6c 6f 67 29 3b 20 20 |urrentDi|alog); |
|00003ef0| 20 20 20 20 20 20 2f 2a | 20 61 6e 64 20 73 65 74 | /*| and set|
|00003f00| 20 74 6f 20 74 68 65 20 | 64 69 61 6c 6f 67 2c 20 | to the |dialog, |
|00003f10| 74 68 69 73 20 69 73 20 | 6e 65 63 65 73 73 61 72 |this is |necessar|
|00003f20| 79 20 2a 2f 0d 20 20 20 | 20 20 20 20 20 20 20 20 |y */. | |
|00003f30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003f40| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 74 6f | | /* to|
|00003f50| 20 74 72 61 63 6b 20 74 | 68 65 20 65 64 69 74 20 | track t|he edit |
|00003f60| 6c 69 6e 65 20 2a 2f 0d | 09 09 09 20 20 20 20 20 |line */.|... |
|00003f70| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 63 75 | | /* cu|
|00003f80| 72 73 6f 72 20 63 68 61 | 6e 67 65 20 63 6f 72 72 |rsor cha|nge corr|
|00003f90| 65 63 74 6c 79 20 2a 2f | 09 0d 2f 2a 20 4e 4f 54 |ectly */|../* NOT|
|00003fa0| 45 3a 20 49 66 20 79 6f | 75 20 61 72 65 20 75 73 |E: If yo|u are us|
|00003fb0| 69 6e 67 20 20 4d 50 57 | 20 33 2e 32 2c 20 74 68 |ing MPW| 3.2, th|
|00003fc0| 65 72 65 20 69 73 20 61 | 20 67 6c 75 65 20 72 6f |ere is a| glue ro|
|00003fd0| 75 74 69 6e 65 20 69 6e | 20 74 68 65 20 49 6e 74 |utine in| the Int|
|00003fe0| 65 72 66 61 63 65 2e 6f | 0d 2f 2a 20 6c 69 62 72 |erface.o|./* libr|
|00003ff0| 61 72 79 20 74 68 61 74 | 20 77 69 6c 6c 20 74 61 |ary that| will ta|
|00004000| 6b 65 20 63 61 72 65 20 | 6f 66 20 74 68 65 20 20 |ke care |of the |
|00004010| 64 65 74 61 69 6c 73 20 | 6f 66 20 67 65 74 74 69 |details |of getti|
|00004020| 6e 67 20 61 6e 64 20 64 | 69 73 70 61 74 63 68 69 |ng and d|ispatchi|
|00004030| 6e 67 20 74 6f 20 74 68 | 65 0d 2f 2a 20 73 74 61 |ng to th|e./* sta|
|00004040| 6e 64 61 72 64 20 66 69 | 6c 74 65 72 20 66 6f 72 |ndard fi|lter for|
|00004050| 20 79 6f 75 2e 20 20 49 | 66 20 79 6f 75 20 61 72 | you. I|f you ar|
|00004060| 65 20 6e 6f 74 20 75 73 | 69 6e 67 20 4d 50 57 20 |e not us|ing MPW |
|00004070| 33 2e 32 2c 20 79 6f 75 | 20 77 69 6c 6c 20 68 61 |3.2, you| will ha|
|00004080| 76 65 20 74 6f 20 63 61 | 6c 6c 20 74 68 65 0d 2f |ve to ca|ll the./|
|00004090| 2a 20 73 74 61 6e 64 61 | 72 64 20 66 69 6c 74 65 |* standa|rd filte|
|000040a0| 72 20 70 72 6f 63 65 64 | 75 72 65 20 79 6f 75 72 |r proced|ure your|
|000040b0| 73 65 6c 66 2e 20 20 42 | 6f 74 68 20 77 61 79 73 |self. B|oth ways|
|000040c0| 20 77 69 6c 6c 20 62 65 | 20 73 68 6f 77 6e 20 68 | will be| shown h|
|000040d0| 65 72 65 2c 20 72 65 6d | 65 6d 62 65 72 20 74 6f |ere, rem|ember to|
|000040e0| 0d 2f 2a 20 6f 6e 6c 79 | 20 75 73 65 20 6f 6e 65 |./* only| use one|
|000040f0| 20 6f 66 20 74 68 65 73 | 65 20 66 6f 72 20 79 6f | of thes|e for yo|
|00004100| 75 20 61 63 74 75 61 6c | 20 69 6d 70 6c 65 6d 65 |u actual| impleme|
|00004110| 6e 74 61 74 69 6f 6e 20 | 2a 2f 0d 23 69 66 64 65 |ntation |*/.#ifde|
|00004120| 66 20 4d 50 57 33 2e 32 | 0d 09 2f 2a 20 75 73 69 |f MPW3.2|../* usi|
|00004130| 6e 67 20 4d 50 57 20 33 | 2e 32 2c 20 75 73 65 20 |ng MPW 3|.2, use |
|00004140| 74 68 65 20 67 6c 75 65 | 20 2a 2f 0d 09 53 74 64 |the glue| */..Std|
|00004150| 46 69 6c 74 65 72 50 72 | 6f 63 28 63 75 72 72 65 |FilterPr|oc(curre|
|00004160| 6e 74 44 69 61 6c 6f 67 | 2c 74 68 65 45 76 65 6e |ntDialog|,theEven|
|00004170| 74 49 6e 2c 74 68 65 44 | 69 61 6c 6f 67 49 74 65 |tIn,theD|ialogIte|
|00004180| 6d 29 3b 20 2f 2a 20 4d | 50 57 20 33 2e 32 20 67 |m); /* M|PW 3.2 g|
|00004190| 6c 75 65 20 09 72 6f 75 | 74 69 6e 65 20 2a 2f 0d |lue .rou|tine */.|
|000041a0| 23 65 6c 73 65 0d 09 2f | 2a 20 6e 6f 74 20 75 73 |#else../|* not us|
|000041b0| 69 6e 67 20 4d 50 57 20 | 33 2e 32 2c 20 67 65 74 |ing MPW |3.2, get|
|000041c0| 20 61 6e 64 20 63 61 6c | 6c 20 74 68 65 20 73 74 | and cal|l the st|
|000041d0| 61 6e 64 61 72 64 20 66 | 69 6c 74 65 72 20 6d 79 |andard f|ilter my|
|000041e0| 73 65 6c 66 20 2a 2f 0d | 09 6d 79 45 72 72 20 3d |self */.|.myErr =|
|000041f0| 20 47 65 74 53 74 64 46 | 69 6c 74 65 72 50 72 6f | GetStdF|ilterPro|
|00004200| 63 28 26 73 74 61 6e 64 | 61 72 64 50 72 6f 63 29 |c(&stand|ardProc)|
|00004210| 3b 20 20 20 2f 2a 20 67 | 65 74 20 74 68 65 20 73 |; /* g|et the s|
|00004220| 74 61 6e 64 61 72 64 20 | 73 79 73 74 65 6d 20 64 |tandard |system d|
|00004230| 69 61 6c 6f 67 20 09 09 | 09 09 09 09 09 2f 2a 20 |ialog ..|...../* |
|00004240| 66 69 6c 74 65 72 20 61 | 64 64 72 65 73 73 20 2a |filter a|ddress *|
|00004250| 2f 0d 09 2f 2a 20 69 66 | 20 69 74 20 77 61 73 20 |/../* if| it was |
|00004260| 6e 6f 74 20 61 6e 20 75 | 70 64 61 74 65 2c 20 77 |not an u|pdate, w|
|00004270| 65 20 70 61 73 73 20 63 | 6f 6e 74 72 6f 6c 20 74 |e pass c|ontrol t|
|00004280| 6f 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 66 |o the st|andard f|
|00004290| 69 6c 74 65 72 20 2a 2f | 09 0d 20 20 20 20 20 20 |ilter */|.. |
|000042a0| 20 69 66 28 21 6d 79 45 | 72 72 29 0d 09 72 65 74 | if(!myE|rr)..ret|
|000042b0| 75 72 6e 56 61 6c 3d 20 | 28 28 4d 6f 64 61 6c 46 |urnVal= |((ModalF|
|000042c0| 69 6c 74 65 72 50 72 6f | 63 50 74 72 29 73 74 61 |ilterPro|cPtr)sta|
|000042d0| 6e 64 61 72 64 50 72 6f | 63 29 28 63 75 72 72 65 |ndardPro|c)(curre|
|000042e0| 6e 74 44 69 61 6c 6f 67 | 2c 74 68 65 45 76 65 6e |ntDialog|,theEven|
|000042f0| 74 49 6e 2c 74 68 65 44 | 69 61 6c 6f 67 49 74 65 |tIn,theD|ialogIte|
|00004300| 6d 29 3b 0d 23 65 6e 64 | 69 66 20 0d 09 53 65 74 |m);.#end|if ..Set|
|00004310| 50 6f 72 74 28 74 65 6d | 70 29 3b 7d 0d 72 65 74 |Port(tem|p);}.ret|
|00004320| 75 72 6e 28 72 65 74 75 | 72 6e 56 61 6c 29 3b 0d |urn(retu|rnVal);.|
|00004330| 7d 0d 4d 50 57 20 50 61 | 73 63 61 6c 0d 7b 20 42 |}.MPW Pa|scal.{ B|
|00004340| 65 66 6f 72 65 20 77 65 | 20 67 6f 20 69 6e 74 6f |efore we| go into|
|00004350| 20 61 20 4d 6f 64 61 6c | 44 69 61 6c 6f 67 20 6c | a Modal|Dialog l|
|00004360| 6f 6f 70 2c 20 64 6f 20 | 61 20 6c 69 74 74 6c 65 |oop, do |a little|
|00004370| 20 70 72 65 70 61 72 61 | 74 69 6f 6e 20 7d 0d 7b | prepara|tion }.{|
|00004380| 20 54 68 69 73 20 69 6e | 6c 69 6e 65 20 64 69 73 | This in|line dis|
|00004390| 70 61 74 63 68 65 73 20 | 74 6f 20 74 68 65 20 73 |patches |to the s|
|000043a0| 74 61 6e 64 61 72 64 20 | 64 69 61 6c 6f 67 20 66 |tandard |dialog f|
|000043b0| 69 6c 74 65 72 20 66 6f | 72 20 79 6f 75 20 7d 0d |ilter fo|r you }.|
|000043c0| 50 52 4f 43 45 44 55 52 | 45 20 43 61 6c 6c 53 74 |PROCEDUR|E CallSt|
|000043d0| 64 46 69 6c 74 65 72 50 | 72 6f 63 28 74 68 65 44 |dFilterP|roc(theD|
|000043e0| 69 61 6c 6f 67 3a 20 44 | 69 61 6c 6f 67 50 74 72 |ialog: D|ialogPtr|
|000043f0| 3b 20 56 41 52 20 65 76 | 65 6e 74 3a 20 45 76 65 |; VAR ev|ent: Eve|
|00004400| 6e 74 52 65 63 6f 72 64 | 3b 20 56 41 52 20 69 74 |ntRecord|; VAR it|
|00004410| 65 6d 48 69 74 3a 20 49 | 4e 54 45 47 45 52 3b 20 |emHit: I|NTEGER; |
|00004420| 73 74 61 6e 64 61 72 64 | 50 72 6f 63 20 3a 20 50 |standard|Proc : P|
|00004430| 72 6f 63 50 74 72 29 3b | 0d 49 4e 4c 49 4e 45 20 |rocPtr);|.INLINE |
|00004440| 24 32 30 35 46 2c 20 24 | 34 45 44 30 3b 0d 7b 20 |$205F, $|4ED0;.{ |
|00004450| 54 68 69 73 20 70 75 6c | 6c 73 20 74 68 65 20 70 |This pul|ls the p|
|00004460| 72 6f 63 20 70 6f 69 6e | 74 65 72 20 6f 66 20 74 |roc poin|ter of t|
|00004470| 68 65 20 73 74 61 63 6b | 20 61 6e 64 20 6a 75 6d |he stack| and jum|
|00004480| 70 73 20 74 6f 20 74 68 | 65 20 73 74 61 6e 64 61 |ps to th|e standa|
|00004490| 72 64 20 66 69 6c 74 65 | 72 2c 20 7d 0d 7b 20 4d |rd filte|r, }.{ M|
|000044a0| 4f 56 45 2e 4c 20 28 53 | 50 29 2b 2c 41 30 20 7d |OVE.L (S|P)+,A0 }|
|000044b0| 0d 7b 20 20 4a 4d 50 20 | 28 41 30 29 20 20 20 20 |.{ JMP |(A0) |
|000044c0| 20 20 20 7d 0d 20 0d 6d | 79 44 69 61 6c 6f 67 50 | }. .m|yDialogP|
|000044d0| 74 72 20 3a 3d 20 47 65 | 74 4e 65 77 44 69 61 6c |tr := Ge|tNewDial|
|000044e0| 6f 67 28 6b 4d 79 44 69 | 61 6c 6f 67 49 44 2c 20 |og(kMyDi|alogID, |
|000044f0| 4e 49 4c 2c 20 57 69 6e | 64 6f 77 50 74 72 28 2d |NIL, Win|dowPtr(-|
|00004500| 31 29 29 3b 0d 6d 79 45 | 72 72 20 3a 3d 20 20 53 |1));.myE|rr := S|
|00004510| 65 74 44 69 61 6c 6f 67 | 44 65 66 61 75 6c 74 49 |etDialog|DefaultI|
|00004520| 74 65 6d 28 6d 79 44 69 | 61 6c 6f 67 50 74 72 2c |tem(myDi|alogPtr,|
|00004530| 20 6f 6b 29 3b 20 7b 20 | 54 65 6c 6c 20 74 68 65 | ok); { |Tell the|
|00004540| 20 44 69 61 6c 6f 67 20 | 4d 61 6e 61 67 65 72 20 | Dialog |Manager |
|00004550| 74 68 65 20 64 65 66 61 | 75 6c 74 20 69 74 65 6d |the defa|ult item|
|00004560| 20 7d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | } | |
|00004570| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004580| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004590| 20 0d 6d 79 45 72 72 20 | 3a 3d 20 53 65 74 44 69 | .myErr |:= SetDi|
|000045a0| 61 6c 6f 67 43 61 6e 63 | 65 6c 49 74 65 6d 28 6d |alogCanc|elItem(m|
|000045b0| 79 44 69 61 6c 6f 67 50 | 74 72 2c 20 63 61 6e 63 |yDialogP|tr, canc|
|000045c0| 65 6c 29 3b 20 7b 20 54 | 65 6c 6c 20 20 44 69 61 |el); { T|ell Dia|
|000045d0| 6c 6f 67 20 4d 61 6e 61 | 67 65 72 20 74 68 65 20 |log Mana|ger the |
|000045e0| 63 61 6e 63 65 6c 20 69 | 74 65 6d 20 7d 0d 6d 79 |cancel i|tem }.my|
|000045f0| 45 72 72 20 3a 3d 20 20 | 53 65 74 44 69 61 6c 6f |Err := |SetDialo|
|00004600| 67 54 72 61 63 6b 73 43 | 75 72 73 6f 72 28 6d 79 |gTracksC|ursor(my|
|00004610| 44 69 61 6c 6f 67 50 74 | 72 2c 20 54 52 55 45 29 |DialogPt|r, TRUE)|
|00004620| 3b 20 7b 20 57 65 20 68 | 61 76 65 20 61 6e 20 65 |; { We h|ave an e|
|00004630| 64 69 74 20 69 74 65 6d | 20 69 6e 20 6f 75 72 20 |dit item| in our |
|00004640| 64 69 61 6c 6f 67 2c 7d | 0d 20 20 20 20 20 20 20 |dialog,}|. |
|00004650| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004660| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004670| 20 20 20 7b 20 20 73 6f | 20 74 65 6c 6c 20 74 68 | { so| tell th|
|00004680| 65 20 44 69 61 6c 6f 67 | 20 4d 61 6e 61 67 65 72 |e Dialog| Manager|
|00004690| 20 74 6f 20 63 68 61 6e | 67 65 0d 09 09 09 09 09 | to chan|ge......|
|000046a0| 20 20 20 20 20 20 28 20 | 20 74 68 65 20 63 75 72 | ( | the cur|
|000046b0| 73 6f 72 20 20 74 6f 20 | 61 6e 20 49 2d 42 65 61 |sor to |an I-Bea|
|000046c0| 6d 20 77 68 65 6e 20 69 | 74 d5 73 20 6f 76 65 72 |m when i|t.s over|
|000046d0| 20 20 09 09 09 09 09 20 | 20 20 20 20 20 28 20 65 | ..... | ( e|
|000046e0| 64 69 74 20 6c 69 6e 65 | 20 7d 0d 52 45 50 45 41 |dit line| }.REPEA|
|000046f0| 54 0d 20 20 4d 6f 64 61 | 6c 44 69 61 6c 6f 67 28 |T. Moda|lDialog(|
|00004700| 40 4d 79 46 69 6c 74 65 | 72 2c 20 68 69 74 49 74 |@MyFilte|r, hitIt|
|00004710| 65 6d 29 3b 0d 55 4e 54 | 49 4c 20 28 28 68 69 74 |em);.UNT|IL ((hit|
|00004720| 49 74 65 6d 20 3d 20 6f | 6b 29 20 4f 52 20 28 68 |Item = o|k) OR (h|
|00004730| 69 74 49 74 65 6d 20 3d | 20 63 61 6e 63 65 6c 29 |itItem =| cancel)|
|00004740| 29 3b 0d 59 6f 75 72 20 | 66 69 6c 74 65 72 20 66 |);.Your |filter f|
|00004750| 6f 72 20 53 79 73 74 65 | 6d 20 37 20 77 69 6c 6c |or Syste|m 7 will|
|00004760| 20 6c 6f 6f 6b 20 73 6f | 6d 65 74 68 69 6e 67 20 | look so|mething |
|00004770| 6c 69 6b 65 20 74 68 69 | 73 3a 0d 46 55 4e 43 54 |like thi|s:.FUNCT|
|00004780| 49 4f 4e 20 4d 79 46 69 | 6c 74 65 72 28 63 75 72 |ION MyFi|lter(cur|
|00004790| 72 65 6e 74 44 69 61 6c | 6f 67 3a 20 44 69 61 6c |rentDial|og: Dial|
|000047a0| 6f 67 50 74 72 3b 20 56 | 41 52 20 74 68 65 45 76 |ogPtr; V|AR theEv|
|000047b0| 65 6e 74 49 6e 3a 20 45 | 76 65 6e 74 52 65 63 6f |entIn: E|ventReco|
|000047c0| 72 64 3b 20 56 41 52 20 | 74 68 65 49 74 65 6d 3a |rd; VAR |theItem:|
|000047d0| 20 49 4e 54 45 47 45 52 | 29 3a 20 42 4f 4f 4c 45 | INTEGER|): BOOLE|
|000047e0| 41 4e 3b 0d 56 41 52 0d | 20 20 73 61 76 65 50 6f |AN;.VAR.| savePo|
|000047f0| 72 74 20 20 20 20 3a 20 | 47 72 61 66 50 6f 72 74 |rt : |GrafPort|
|00004800| 3b 0d 42 45 47 49 4e 0d | 20 20 7b 20 69 66 20 74 |;.BEGIN.| { if t|
|00004810| 68 65 20 75 70 64 61 74 | 65 20 69 73 20 66 6f 72 |he updat|e is for|
|00004820| 20 74 68 65 20 64 69 61 | 6c 6f 67 20 62 6f 78 2c | the dia|log box,|
|00004830| 20 69 67 6e 6f 72 65 20 | 69 74 20 73 69 6e 63 65 | ignore |it since|
|00004840| 20 74 68 65 20 72 65 67 | 75 6c 61 72 20 4d 6f 64 | the reg|ular Mod|
|00004850| 61 6c 44 69 61 6c 6f 67 | 0d 20 20 7b 20 66 75 6e |alDialog|. { fun|
|00004860| 63 74 69 6f 6e 20 77 69 | 6c 6c 20 72 65 64 72 61 |ction wi|ll redra|
|00004870| 77 20 69 74 20 61 73 20 | 6e 65 63 65 73 73 61 72 |w it as |necessar|
|00004880| 79 20 7d 0d 20 20 49 46 | 20 28 74 68 65 45 76 65 |y }. IF| (theEve|
|00004890| 6e 74 49 6e 2e 77 68 61 | 74 20 3d 20 75 70 64 61 |ntIn.wha|t = upda|
|000048a0| 74 65 45 76 74 20 41 4e | 44 20 74 68 65 45 76 65 |teEvt AN|D theEve|
|000048b0| 6e 74 49 6e 2e 6d 65 73 | 73 61 67 65 20 3c 3e 20 |ntIn.mes|sage <> |
|000048c0| 63 75 72 72 65 6e 74 44 | 69 61 6c 6f 67 29 0d 20 |currentD|ialog). |
|000048d0| 20 20 20 20 20 4d 79 46 | 69 6c 74 65 72 20 3a 3d | MyF|ilter :=|
|000048e0| 20 4d 79 44 72 61 77 50 | 72 6f 63 28 63 75 72 72 | MyDrawP|roc(curr|
|000048f0| 65 6e 74 44 69 61 6c 6f | 67 29 0d 20 20 45 4c 53 |entDialo|g). ELS|
|00004900| 45 0d 20 20 20 20 42 45 | 47 49 4e 0d 20 20 20 20 |E. BE|GIN. |
|00004910| 20 20 47 65 74 50 6f 72 | 74 28 73 61 76 65 50 6f | GetPor|t(savePo|
|00004920| 72 74 29 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |rt); | |
|00004930| 7b 20 73 61 76 65 20 74 | 68 65 20 63 75 72 72 65 |{ save t|he curre|
|00004940| 6e 74 20 70 6f 72 74 20 | 7d 0d 20 20 20 20 20 20 |nt port |}. |
|00004950| 53 65 74 50 6f 72 74 28 | 63 75 72 72 65 6e 74 44 |SetPort(|currentD|
|00004960| 69 61 6c 6f 67 29 3b 20 | 20 20 20 20 20 20 7b 20 |ialog); | { |
|00004970| 73 65 74 20 74 6f 20 74 | 68 65 20 64 69 61 6c 6f |set to t|he dialo|
|00004980| 67 2c 20 74 68 69 73 20 | 69 73 20 6e 65 63 65 73 |g, this |is neces|
|00004990| 73 61 72 79 20 74 6f 20 | 7d 0d 20 20 20 20 20 20 |sary to |}. |
|000049a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000049b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7b 20 | | { |
|000049c0| 74 72 61 63 6b 20 74 68 | 65 20 65 64 69 74 20 6c |track th|e edit l|
|000049d0| 69 6e 65 20 63 75 72 73 | 6f 72 20 63 68 61 6e 67 |ine curs|or chang|
|000049e0| 65 20 63 6f 72 72 65 63 | 74 6c 79 20 7d 20 0d 7b |e correc|tly } .{|
|000049f0| 20 4e 4f 54 45 3a 20 49 | 66 20 79 6f 75 20 61 72 | NOTE: I|f you ar|
|00004a00| 65 20 75 73 69 6e 67 20 | 20 4d 50 57 20 33 2e 32 |e using | MPW 3.2|
|00004a10| 2c 20 74 68 65 72 65 20 | 69 73 20 61 20 67 6c 75 |, there |is a glu|
|00004a20| 65 20 72 6f 75 74 69 6e | 65 20 69 6e 20 74 68 65 |e routin|e in the|
|00004a30| 20 49 6e 74 65 72 66 61 | 63 65 2e 6f 20 6c 69 62 | Interfa|ce.o lib|
|00004a40| 72 61 72 79 20 7d 0d 7b | 20 74 68 61 74 20 77 69 |rary }.{| that wi|
|00004a50| 6c 6c 20 74 61 6b 65 20 | 63 61 72 65 20 6f 66 20 |ll take |care of |
|00004a60| 74 68 65 20 20 64 65 74 | 61 69 6c 73 20 6f 66 20 |the det|ails of |
|00004a70| 67 65 74 74 69 6e 67 20 | 61 6e 64 20 64 69 73 70 |getting |and disp|
|00004a80| 61 74 63 68 69 6e 67 20 | 74 6f 20 74 68 65 20 73 |atching |to the s|
|00004a90| 74 61 6e 64 61 72 64 20 | 0d 28 20 66 69 6c 74 65 |tandard |.( filte|
|00004aa0| 72 20 66 6f 72 20 79 6f | 75 2e 20 20 49 66 20 79 |r for yo|u. If y|
|00004ab0| 6f 75 20 61 72 65 20 6e | 6f 74 20 75 73 69 6e 67 |ou are n|ot using|
|00004ac0| 20 4d 50 57 20 33 2e 32 | 2c 20 79 6f 75 20 77 69 | MPW 3.2|, you wi|
|00004ad0| 6c 6c 20 68 61 76 65 20 | 74 6f 20 63 61 6c 6c 20 |ll have |to call |
|00004ae0| 74 68 65 20 73 74 61 6e | 64 61 72 64 0d 28 20 66 |the stan|dard.( f|
|00004af0| 69 6c 74 65 72 20 70 72 | 6f 63 65 64 75 72 65 20 |ilter pr|ocedure |
|00004b00| 79 6f 75 72 73 65 6c 66 | 2e 20 20 42 6f 74 68 20 |yourself|. Both |
|00004b10| 77 61 79 73 20 77 69 6c | 6c 20 62 65 20 73 68 6f |ways wil|l be sho|
|00004b20| 77 6e 20 68 65 72 65 2c | 20 72 65 6d 65 6d 62 65 |wn here,| remembe|
|00004b30| 72 20 74 6f 20 6f 6e 6c | 79 20 75 73 65 20 6f 6e |r to onl|y use on|
|00004b40| 65 0d 28 20 6f 66 20 74 | 68 65 73 65 20 66 6f 72 |e.( of t|hese for|
|00004b50| 20 79 6f 75 20 61 63 74 | 75 61 6c 20 69 6d 70 6c | you act|ual impl|
|00004b60| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 7d 0d 7b 24 49 |ementati|on }.{$I|
|00004b70| 46 43 20 4d 50 57 33 2e | 32 20 7d 0d 09 7b 20 75 |FC MPW3.|2 }..{ u|
|00004b80| 73 69 6e 67 20 4d 50 57 | 20 33 2e 32 2c 20 75 73 |sing MPW| 3.2, us|
|00004b90| 65 20 74 68 65 20 67 6c | 75 65 20 7d 0d 09 53 74 |e the gl|ue }..St|
|00004ba0| 64 46 69 6c 74 65 72 50 | 72 6f 63 63 75 72 72 65 |dFilterP|roccurre|
|00004bb0| 6e 74 44 69 61 6c 6f 67 | 2c 20 74 68 65 45 76 65 |ntDialog|, theEve|
|00004bc0| 6e 74 49 6e 2c 20 74 68 | 65 49 74 65 6d 29 3b 20 |ntIn, th|eItem); |
|00004bd0| 7b 20 4d 50 57 20 33 2e | 32 20 67 6c 75 65 20 72 |{ MPW 3.|2 glue r|
|00004be0| 6f 75 74 69 6e 65 20 7d | 0d 7b 24 45 4c 53 45 43 |outine }|.{$ELSEC|
|00004bf0| 7d 0d 09 7b 20 6e 6f 74 | 20 75 73 69 6e 67 20 4d |}..{ not| using M|
|00004c00| 50 57 20 33 2e 32 2c 20 | 67 65 74 20 61 6e 64 20 |PW 3.2, |get and |
|00004c10| 63 61 6c 6c 20 74 68 65 | 20 73 74 61 6e 64 61 72 |call the| standar|
|00004c20| 64 20 66 69 6c 74 65 72 | 20 6d 79 73 65 6c 66 20 |d filter| myself |
|00004c30| 7d 0d 20 20 20 20 20 20 | 6d 79 45 72 72 20 3a 3d |}. |myErr :=|
|00004c40| 20 47 65 74 53 74 64 46 | 69 6c 74 65 72 50 72 6f | GetStdF|ilterPro|
|00004c50| 63 28 67 53 74 61 6e 64 | 61 72 64 50 72 6f 63 29 |c(gStand|ardProc)|
|00004c60| 3b 20 7b 67 65 74 20 74 | 68 65 20 63 75 72 72 65 |; {get t|he curre|
|00004c70| 6e 74 20 73 79 73 74 65 | 6d 20 73 74 61 6e 64 61 |nt syste|m standa|
|00004c80| 72 64 20 09 09 09 09 09 | 09 20 20 20 20 20 28 66 |rd .....|. (f|
|00004c90| 69 6c 74 65 72 20 61 6e | 64 20 73 74 6f 72 65 20 |ilter an|d store |
|00004ca0| 69 74 20 69 6e 20 61 20 | 67 6c 6f 62 61 6c 2c 20 |it in a |global, |
|00004cb0| 73 6f 20 0d 09 09 09 09 | 09 09 20 20 20 20 20 28 |so .....|.. (|
|00004cc0| 20 6f 75 72 20 61 73 73 | 65 6d 62 6c 79 20 67 6c | our ass|embly gl|
|00004cd0| 75 65 20 63 61 6e 20 75 | 73 65 20 69 74 20 7d 0d |ue can u|se it }.|
|00004ce0| 09 09 09 09 09 09 20 20 | 20 20 20 28 20 69 66 20 |...... | ( if |
|00004cf0| 69 74 20 77 61 73 20 6e | 6f 74 20 61 6e 20 75 70 |it was n|ot an up|
|00004d00| 64 61 74 65 2c 20 70 61 | 73 73 0d 09 09 09 09 09 |date, pa|ss......|
|00004d10| 09 20 20 20 20 20 28 20 | 63 6f 6e 74 72 6f 6c 20 |. ( |control |
|00004d20| 74 6f 20 74 68 65 20 61 | 73 73 65 6d 62 6c 79 20 |to the a|ssembly |
|00004d30| 67 6c 75 65 20 74 68 61 | 74 20 09 09 09 09 09 09 |glue tha|t ......|
|00004d40| 20 20 20 20 20 28 20 77 | 69 6c 6c 20 63 61 6c 6c | ( w|ill call|
|00004d50| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 66 69 | the sta|ndard fi|
|00004d60| 6c 74 65 72 20 7d 0d 20 | 20 20 20 20 20 49 46 20 |lter }. | IF |
|00004d70| 6d 79 45 72 72 20 3d 20 | 6e 6f 45 72 72 20 54 48 |myErr = |noErr TH|
|00004d80| 45 4e 0d 09 20 20 20 4d | 79 46 69 6c 74 65 72 20 |EN.. M|yFilter |
|00004d90| 3a 3d 20 43 61 6c 6c 53 | 74 64 46 69 6c 74 65 72 |:= CallS|tdFilter|
|00004da0| 50 72 6f 63 28 63 75 72 | 72 65 6e 74 44 69 61 6c |Proc(cur|rentDial|
|00004db0| 6f 67 2c 20 74 68 65 45 | 76 65 6e 74 49 6e 2c 20 |og, theE|ventIn, |
|00004dc0| 74 68 65 49 74 65 6d 2c | 67 53 74 61 6e 64 61 72 |theItem,|gStandar|
|00004dd0| 64 50 72 6f 63 29 3b 0d | 7b 24 45 4e 44 43 7d 0d |dProc);.|{$ENDC}.|
|00004de0| 20 20 20 20 20 20 53 65 | 74 50 6f 72 74 28 73 61 | Se|tPort(sa|
|00004df0| 76 65 50 6f 72 74 29 3b | 20 20 20 20 20 20 20 20 |vePort);| |
|00004e00| 20 20 20 20 7b 20 72 65 | 73 74 6f 72 65 20 74 68 | { re|store th|
|00004e10| 65 20 73 61 76 65 64 20 | 70 6f 72 74 20 7d 0d 20 |e saved |port }. |
|00004e20| 20 20 20 45 4e 44 3b 0d | 45 4e 44 3b 0d 54 68 65 | END;.|END;.The|
|00004e30| 20 53 79 73 74 65 6d 20 | 36 20 57 61 79 0d 4f 66 | System |6 Way.Of|
|00004e40| 20 63 6f 75 72 73 65 2c | 20 75 6e 64 65 72 20 70 | course,| under p|
|00004e50| 72 65 2d 53 79 73 74 65 | 6d 20 37 20 61 70 70 6c |re-Syste|m 7 appl|
|00004e60| 69 63 61 74 69 6f 6e 73 | 20 79 6f 75 20 63 61 6e |ications| you can|
|00004e70| d5 74 20 75 73 65 20 74 | 68 65 20 6e 65 77 20 63 |.t use t|he new c|
|00004e80| 61 6c 6c 73 2c 20 73 6f | 20 79 6f 75 20 68 61 76 |alls, so| you hav|
|00004e90| 65 20 74 6f 20 64 6f 20 | 69 74 20 79 6f 75 72 73 |e to do |it yours|
|00004ea0| 65 6c 66 2e 20 20 48 65 | 72 65 d5 73 20 61 20 73 |elf. He|re.s a s|
|00004eb0| 61 6d 70 6c 65 20 53 79 | 73 74 65 6d 20 36 2e 30 |ample Sy|stem 6.0|
|00004ec0| 2e 78 20 66 69 6c 74 65 | 72 20 70 72 6f 63 20 74 |.x filte|r proc t|
|00004ed0| 68 61 74 20 64 6f 65 73 | 20 72 6f 75 67 68 6c 79 |hat does| roughly|
|00004ee0| 20 74 68 65 20 73 61 6d | 65 20 74 68 69 6e 67 2e | the sam|e thing.|
|00004ef0| 20 20 4f 66 20 63 6f 75 | 72 73 65 2c 20 79 6f 75 | Of cou|rse, you|
|00004f00| 20 20 63 61 6e d5 74 20 | 63 61 6c 6c 20 74 68 65 | can.t |call the|
|00004f10| 20 6e 65 77 20 44 69 61 | 6c 6f 67 20 4d 61 6e 61 | new Dia|log Mana|
|00004f20| 67 65 72 20 72 6f 75 74 | 69 6e 65 73 20 75 6e 64 |ger rout|ines und|
|00004f30| 65 72 20 53 79 73 74 65 | 6d 20 36 2e 0d 4d 50 57 |er Syste|m 6..MPW|
|00004f40| 20 43 0d 2f 2a 20 50 72 | 65 2d 73 79 73 74 65 6d | C./* Pr|e-system|
|00004f50| 20 37 20 64 69 61 6c 6f | 67 20 66 69 6c 74 65 72 | 7 dialo|g filter|
|00004f60| 20 2a 2f 0d 70 61 73 63 | 61 6c 20 42 6f 6f 6c 65 | */.pasc|al Boole|
|00004f70| 61 6e 20 4d 79 46 69 6c | 74 65 72 28 44 69 61 6c |an MyFil|ter(Dial|
|00004f80| 6f 67 50 74 72 20 63 75 | 72 72 65 6e 74 44 69 61 |ogPtr cu|rrentDia|
|00004f90| 6c 6f 67 2c 20 45 76 65 | 6e 74 52 65 63 6f 72 64 |log, Eve|ntRecord|
|00004fa0| 20 2a 74 68 65 45 76 65 | 6e 74 49 6e 2c 20 73 68 | *theEve|ntIn, sh|
|00004fb0| 6f 72 74 20 2a 74 68 65 | 44 69 61 6c 6f 67 49 74 |ort *the|DialogIt|
|00004fc0| 65 6d 29 0d 7b 20 2f 2a | 20 64 65 63 6c 61 72 65 |em).{ /*| declare|
|00004fd0| 64 20 61 73 20 d4 70 61 | 73 63 61 6c d5 20 73 69 |d as .pa|scal. si|
|00004fe0| 6e 63 65 20 69 74 d5 73 | 20 63 61 6c 6c 65 64 20 |nce it.s| called |
|00004ff0| 62 79 20 74 68 65 20 74 | 6f 6f 6c 62 6f 78 20 2a |by the t|oolbox *|
|00005000| 2f 0d 23 64 65 66 69 6e | 65 20 6b 4d 79 42 75 74 |/.#defin|e kMyBut|
|00005010| 74 6f 6e 44 65 6c 61 79 | 20 38 0d 42 6f 6f 6c 65 |tonDelay| 8.Boole|
|00005020| 61 6e 20 72 65 74 75 72 | 6e 56 61 6c 20 3d 20 66 |an retur|nVal = f|
|00005030| 61 6c 73 65 3b 0d 6c 6f | 6e 67 20 77 61 69 74 54 |alse;.lo|ng waitT|
|00005040| 69 63 6b 73 3b 0d 73 68 | 6f 72 74 20 69 74 65 6d |icks;.sh|ort item|
|00005050| 4b 69 6e 64 3b 20 20 20 | 20 20 20 20 20 20 20 20 |Kind; | |
|00005060| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005070| 20 2f 2a 20 73 6f 6d 65 | 20 74 65 6d 70 6f 72 61 | /* some| tempora|
|00005080| 72 79 20 76 61 72 69 61 | 62 6c 65 73 20 66 6f 72 |ry varia|bles for|
|00005090| 20 47 65 74 44 49 74 65 | 6d 0d 20 20 20 20 20 20 | GetDIte|m. |
|000050a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000050b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000050c0| 20 20 20 20 20 20 20 20 | 75 73 65 20 2a 2f 0d 48 | |use */.H|
|000050d0| 61 6e 64 6c 65 20 69 74 | 65 6d 48 61 6e 64 6c 65 |andle it|emHandle|
|000050e0| 3b 0d 52 65 63 74 20 69 | 74 65 6d 52 65 63 74 3b |;.Rect i|temRect;|
|000050f0| 0d 69 66 28 74 68 65 45 | 76 65 6e 74 49 6e 2d 3e |.if(theE|ventIn->|
|00005100| 77 68 61 74 20 3d 3d 20 | 75 70 64 61 74 65 45 76 |what == |updateEv|
|00005110| 74 20 26 26 20 20 74 68 | 65 45 76 65 6e 74 49 6e |t && th|eEventIn|
|00005120| 2d 3e 6d 65 73 73 61 67 | 65 20 21 3d 20 6d 79 44 |->messag|e != myD|
|00005130| 69 61 6c 6f 67 50 74 72 | 20 29 20 7b 0d 09 09 09 |ialogPtr| ) {....|
|00005140| 09 09 09 2f 2a 20 6d 79 | 44 69 61 6c 6f 67 50 74 |.../* my|DialogPt|
|00005150| 72 20 69 73 20 64 65 66 | 69 6e 65 64 20 77 68 65 |r is def|ined whe|
|00005160| 72 65 20 79 6f 75 20 63 | 72 65 61 74 65 64 20 74 |re you c|reated t|
|00005170| 68 65 20 64 69 61 6c 6f | 67 20 09 09 09 09 09 09 |he dialo|g ......|
|00005180| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/. | |
|00005190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000051e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000051f0| 20 69 66 20 74 68 65 20 | 75 70 64 61 74 65 20 69 | if the |update i|
|00005200| 73 20 66 6f 72 20 74 68 | 65 20 64 69 61 6c 6f 67 |s for th|e dialog|
|00005210| 20 62 6f 78 2c 0d 20 20 | 20 20 20 20 20 20 20 20 | box,. | |
|00005220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005230| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005240| 20 2f 2a 20 69 67 6e 6f | 72 65 20 69 74 20 73 69 | /* igno|re it si|
|00005250| 6e 63 65 20 74 68 65 20 | 72 65 67 75 6c 61 72 0d |nce the |regular.|
|00005260| 09 09 09 09 09 09 2f 2a | 20 4d 6f 64 61 6c 44 69 |....../*| ModalDi|
|00005270| 61 6c 6f 67 20 66 75 6e | 63 74 69 6f 6e 20 77 69 |alog fun|ction wi|
|00005280| 6c 6c 20 20 72 65 64 72 | 61 77 20 69 74 20 09 09 |ll redr|aw it ..|
|00005290| 09 09 09 09 2f 2a 20 61 | 73 20 6e 65 63 65 73 73 |..../* a|s necess|
|000052a0| 61 72 79 20 2a 2f 09 0d | 20 72 65 74 75 72 6e 56 |ary */..| returnV|
|000052b0| 61 6c 20 3d 20 4d 79 44 | 72 61 77 50 72 6f 63 28 |al = MyD|rawProc(|
|000052c0| 74 68 65 45 76 65 6e 74 | 49 6e 2d 3e 6d 65 73 73 |theEvent|In->mess|
|000052d0| 61 67 65 29 3b 20 20 20 | 20 2f 2a 20 67 6f 20 74 |age); | /* go t|
|000052e0| 6f 20 6d 79 20 64 72 61 | 77 69 6e 67 20 72 6f 75 |o my dra|wing rou|
|000052f0| 74 69 6e 65 20 2a 2f 20 | 20 0d 20 20 20 20 7d 20 |tine */ | . } |
|00005300| 65 6c 73 65 20 7b 20 20 | 20 0d 20 20 20 20 20 20 |else { | . |
|00005310| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005330| 20 20 20 20 20 2f 2a 20 | 69 74 20 77 61 73 6e d5 | /* |it wasn.|
|00005340| 74 20 61 6e 20 75 70 64 | 61 74 65 2c 20 73 65 65 |t an upd|ate, see|
|00005350| 20 69 66 20 69 74 20 77 | 61 73 20 61 0d 20 20 20 | if it w|as a. |
|00005360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005370| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005380| 20 20 20 20 20 20 20 20 | 2f 2a 20 6b 65 79 73 74 | |/* keyst|
|00005390| 72 6f 6b 65 2e 20 43 68 | 65 63 6b 20 66 6f 72 20 |roke. Ch|eck for |
|000053a0| 74 68 65 20 72 65 74 75 | 72 6e 20 6f 72 0d 20 20 |the retu|rn or. |
|000053b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000053c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000053d0| 20 20 20 20 20 20 20 20 | 20 2f 2a 20 65 6e 74 65 | | /* ente|
|000053e0| 72 20 6b 65 79 2c 20 61 | 6e 64 20 61 6c 69 61 73 |r key, a|nd alias|
|000053f0| 20 74 68 61 74 20 61 73 | 20 69 74 65 6d 20 31 2e | that as| item 1.|
|00005400| 20 09 09 09 09 09 09 2a | 2f 20 49 20 61 6c 73 6f | ......*|/ I also|
|00005410| 20 69 6e 63 6c 75 64 65 | 64 20 61 20 63 68 65 63 | include|d a chec|
|00005420| 6b 20 68 65 72 65 20 66 | 6f 72 20 74 68 65 0d 20 |k here f|or the. |
|00005430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005440| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005450| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 20 65 73 | | /* es|
|00005460| 63 61 70 65 20 6b 65 79 | 20 61 6c 69 61 73 69 6e |cape key| aliasin|
|00005470| 67 20 61 73 20 69 74 65 | 6d 20 32 2c 20 79 6f 75 |g as ite|m 2, you|
|00005480| 0d 09 09 09 09 09 09 2f | 2a 20 6d 61 79 20 6e 6f |......./|* may no|
|00005490| 74 20 77 61 6e 74 20 74 | 6f 20 75 73 65 20 74 68 |t want t|o use th|
|000054a0| 61 74 20 2a 2f 0d 20 20 | 20 20 20 20 20 20 69 66 |at */. | if|
|000054b0| 20 28 28 74 68 65 45 76 | 65 6e 74 49 6e 2d 3e 77 | ((theEv|entIn->w|
|000054c0| 68 61 74 20 3d 3d 20 6b | 65 79 44 6f 77 6e 29 20 |hat == k|eyDown) |
|000054d0| 7c 7c 20 28 74 68 65 45 | 76 65 6e 74 49 6e 2d 3e ||| (theE|ventIn->|
|000054e0| 77 68 61 74 20 3d 3d 20 | 61 75 74 6f 4b 65 79 29 |what == |autoKey)|
|000054f0| 29 7b 20 0d 20 20 20 20 | 20 20 20 20 2f 2a 20 69 |){ . | /* i|
|00005500| 74 20 77 61 73 20 61 20 | 6b 65 79 20 2a 2f 20 20 |t was a |key */ |
|00005510| 20 20 20 0d 20 20 20 20 | 20 20 20 20 73 77 69 74 | . | swit|
|00005520| 63 68 20 28 74 68 65 45 | 76 65 6e 74 49 6e 2d 3e |ch (theE|ventIn->|
|00005530| 6d 65 73 73 61 67 65 20 | 26 20 63 68 61 72 43 6f |message |& charCo|
|00005540| 64 65 4d 61 73 6b 29 20 | 7b 0d 20 20 20 20 20 20 |deMask) |{. |
|00005550| 20 20 20 20 20 20 63 61 | 73 65 20 6b 52 65 74 75 | ca|se kRetu|
|00005560| 72 6e 4b 65 79 3a 0d 20 | 20 20 20 20 20 20 20 20 |rnKey:. | |
|00005570| 20 20 20 63 61 73 65 20 | 6b 45 6e 74 65 72 4b 65 | case |kEnterKe|
|00005580| 79 3a 20 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |y: . | |
|00005590| 2a 74 68 65 44 69 61 6c | 6f 67 49 74 65 6d 20 3d |*theDial|ogItem =|
|000055a0| 20 6f 6b 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 | ok; | |
|000055b0| 20 20 20 20 2f 2a 20 63 | 68 61 6e 67 65 20 77 68 | /* c|hange wh|
|000055c0| 61 74 65 76 65 72 20 74 | 68 65 20 63 75 72 72 65 |atever t|he curre|
|000055d0| 6e 74 20 69 74 65 6d 20 | 69 73 20 74 6f 0d 20 20 |nt item |is to. |
|000055e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000055f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005600| 20 20 20 20 20 20 20 2f | 2a 20 74 68 65 20 4f 4b | /|* the OK|
|00005610| 20 69 74 65 6d 20 6f 6b | 20 69 73 20 23 64 65 66 | item ok| is #def|
|00005620| 69 6e 65 64 20 69 6e 20 | 44 69 61 6c 6f 67 73 2e |ined in |Dialogs.|
|00005630| 68 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |h. | |
|00005640| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005650| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 61 73 | | /* as|
|00005660| 20 6e 6f 77 20 77 65 20 | 6e 65 65 64 20 74 6f 20 | now we |need to |
|00005670| 69 6e 76 65 72 74 20 74 | 68 65 20 62 75 74 74 6f |invert t|he butto|
|00005680| 6e 20 73 6f 0d 20 20 20 | 20 20 20 20 20 20 20 20 |n so. | |
|00005690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000056a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000056b0| 20 74 68 65 20 75 73 65 | 72 20 67 65 74 73 20 74 | the use|r gets t|
|000056c0| 68 65 20 72 69 67 68 74 | 20 66 65 65 64 62 61 63 |he right| feedbac|
|000056d0| 6b 20 2a 2f 20 20 20 20 | 20 20 20 20 20 20 20 20 |k */ | |
|000056e0| 47 65 74 44 49 74 65 6d | 28 63 75 72 72 65 6e 74 |GetDItem|(current|
|000056f0| 44 69 61 6c 6f 67 2c 6f | 6b 2c 26 69 74 65 6d 4b |Dialog,o|k,&itemK|
|00005700| 69 6e 64 2c 26 69 74 65 | 6d 48 61 6e 64 6c 65 2c |ind,&ite|mHandle,|
|00005710| 26 69 74 65 6d 52 65 63 | 74 29 3b 0d 20 20 20 20 |&itemRec|t);. |
|00005720| 20 20 20 20 20 20 20 20 | 48 69 6c 69 74 65 43 6f | |HiliteCo|
|00005730| 6e 74 72 6f 6c 28 28 43 | 6f 6e 74 72 6f 6c 48 61 |ntrol((C|ontrolHa|
|00005740| 6e 64 6c 65 29 69 74 65 | 6d 48 61 6e 64 6c 65 2c |ndle)ite|mHandle,|
|00005750| 20 69 6e 42 75 74 74 6f | 6e 29 3b 20 2f 2a 20 69 | inButto|n); /* i|
|00005760| 6e 76 65 72 74 20 74 68 | 65 20 62 75 74 74 6f 6e |nvert th|e button|
|00005770| 20 2a 2f 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00005780| 44 65 6c 61 79 28 6b 4d | 79 42 75 74 74 6f 6e 44 |Delay(kM|yButtonD|
|00005790| 65 6c 61 79 20 2c 20 26 | 77 61 69 74 54 69 63 6b |elay , &|waitTick|
|000057a0| 73 29 3b 20 20 20 2f 2a | 20 77 61 69 74 20 61 62 |s); /*| wait ab|
|000057b0| 6f 75 74 20 38 20 74 69 | 63 6b 73 20 73 6f 20 74 |out 8 ti|cks so t|
|000057c0| 68 65 79 20 63 61 6e 20 | 73 65 65 20 69 74 20 2a |hey can |see it *|
|000057d0| 2f 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 48 69 |/. | Hi|
|000057e0| 6c 69 74 65 43 6f 6e 74 | 72 6f 6c 28 28 43 6f 6e |liteCont|rol((Con|
|000057f0| 74 72 6f 6c 48 61 6e 64 | 6c 65 29 69 74 65 6d 48 |trolHand|le)itemH|
|00005800| 61 6e 64 6c 65 2c 20 66 | 61 6c 73 65 29 3b 20 20 |andle, f|alse); |
|00005810| 2f 2a 20 61 6e 64 20 62 | 61 63 6b 20 74 6f 20 6e |/* and b|ack to n|
|00005820| 6f 72 6d 61 6c 20 2a 2f | 0d 20 20 20 20 20 20 20 |ormal */|. |
|00005830| 20 20 20 20 20 20 20 20 | 20 0d 20 20 20 20 20 20 | | . |
|00005840| 20 20 20 20 20 20 72 65 | 74 75 72 6e 56 61 6c 20 | re|turnVal |
|00005850| 3d 20 74 72 75 65 3b 20 | 20 20 20 20 20 20 20 20 |= true; | |
|00005860| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 74 65 6c | | /* tel|
|00005870| 6c 20 74 68 65 20 44 69 | 61 6c 6f 67 20 4d 61 6e |l the Di|alog Man|
|00005880| 61 67 65 72 20 77 65 20 | 68 61 6e 64 6c 65 64 20 |ager we |handled |
|00005890| 74 68 69 73 0d 20 20 20 | 20 20 20 20 20 20 20 20 |this. | |
|000058a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000058b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a | | /*|
|000058c0| 20 65 76 65 6e 74 20 2a | 2f 0d 20 20 20 20 20 20 | event *|/. |
|000058d0| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0d 20 20 20 | br|eak;. |
|000058e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000058f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005900| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005910| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005920| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005940| 20 2f 2a 20 54 68 69 73 | 20 66 69 6c 74 65 72 73 | /* This| filters|
|00005950| 20 74 68 65 20 65 73 63 | 61 70 65 20 6b 65 79 20 | the esc|ape key |
|00005960| 20 74 68 65 20 73 61 6d | 65 20 61 73 0d 20 20 20 | the sam|e as. |
|00005970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005990| 20 20 20 20 20 2f 2a 20 | 20 69 74 65 6d 20 32 20 | /* | item 2 |
|000059a0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/. | |
|000059b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000059c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000059d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000059e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000059f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005a00| 20 20 20 20 20 20 20 2f | 2a 20 28 74 68 65 20 63 | /|* (the c|
|00005a10| 61 6e 63 65 6c 20 62 75 | 74 74 6f 6e 2c 75 73 75 |ancel bu|tton,usu|
|00005a20| 61 6c 6c 79 20 29 20 2a | 2f 0d 20 20 20 20 20 20 |ally ) *|/. |
|00005a30| 20 20 20 20 20 20 63 61 | 73 65 20 6b 45 73 63 4b | ca|se kEscK|
|00005a40| 65 79 3a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ey:. | |
|00005a50| 2a 74 68 65 44 69 61 6c | 6f 67 49 74 65 6d 20 3d |*theDial|ogItem =|
|00005a60| 20 63 61 6e 63 65 6c 3b | 20 20 20 20 20 20 20 20 | cancel;| |
|00005a70| 20 20 20 2f 2a 20 63 61 | 6e 63 65 6c 20 69 73 20 | /* ca|ncel is |
|00005a80| 23 64 65 66 69 6e 65 64 | 20 69 6e 20 44 69 61 6c |#defined| in Dial|
|00005a90| 6f 67 73 2e 68 20 61 73 | 20 32 20 2a 2f 0d 20 20 |ogs.h as| 2 */. |
|00005aa0| 20 20 20 20 20 20 20 20 | 20 20 47 65 74 44 49 74 | | GetDIt|
|00005ab0| 65 6d 28 63 75 72 72 65 | 6e 74 44 69 61 6c 6f 67 |em(curre|ntDialog|
|00005ac0| 2c 63 61 6e 63 65 6c 2c | 26 69 74 65 6d 4b 69 6e |,cancel,|&itemKin|
|00005ad0| 64 2c 26 69 74 65 6d 48 | 61 6e 64 6c 65 2c 26 69 |d,&itemH|andle,&i|
|00005ae0| 74 65 6d 52 65 63 74 29 | 3b 0d 20 20 20 20 20 20 |temRect)|;. |
|00005af0| 20 20 20 20 20 20 20 48 | 69 6c 69 74 65 43 6f 6e | H|iliteCon|
|00005b00| 74 72 6f 6c 28 28 43 6f | 6e 74 72 6f 6c 48 61 6e |trol((Co|ntrolHan|
|00005b10| 64 6c 65 29 69 74 65 6d | 48 61 6e 64 6c 65 2c 20 |dle)item|Handle, |
|00005b20| 69 6e 42 75 74 74 6f 6e | 29 3b 0d 20 20 20 20 20 |inButton|);. |
|00005b30| 20 20 20 20 20 20 20 20 | 44 65 6c 61 79 28 6b 4d | |Delay(kM|
|00005b40| 79 42 75 74 74 6f 6e 44 | 65 6c 61 79 20 2c 20 26 |yButtonD|elay , &|
|00005b50| 77 61 69 74 54 69 63 6b | 73 29 3b 2f 2a 20 77 61 |waitTick|s);/* wa|
|00005b60| 69 74 20 61 62 6f 75 74 | 20 38 20 74 69 63 6b 73 |it about| 8 ticks|
|00005b70| 20 73 6f 20 74 68 65 79 | 20 63 61 6e 20 73 65 65 | so they| can see|
|00005b80| 20 69 74 20 2a 2f 0d 20 | 20 20 20 20 20 20 20 20 | it */. | |
|00005b90| 20 20 20 20 48 69 6c 69 | 74 65 43 6f 6e 74 72 6f | Hili|teContro|
|00005ba0| 6c 28 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |l((Contr|olHandle|
|00005bb0| 29 69 74 65 6d 48 61 6e | 64 6c 65 2c 20 66 61 6c |)itemHan|dle, fal|
|00005bc0| 73 65 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |se);. | |
|00005bd0| 20 72 65 74 75 72 6e 56 | 61 6c 20 3d 20 74 72 75 | returnV|al = tru|
|00005be0| 65 3b 20 20 2f 2a 20 74 | 65 6c 6c 20 74 68 65 20 |e; /* t|ell the |
|00005bf0| 44 69 61 6c 6f 67 20 4d | 61 6e 61 67 65 72 20 77 |Dialog M|anager w|
|00005c00| 65 20 68 61 6e 64 6c 65 | 64 20 74 68 69 73 20 65 |e handle|d this e|
|00005c10| 76 65 6e 74 20 2a 2f 0d | 20 20 20 20 20 20 20 20 |vent */.| |
|00005c20| 20 20 20 20 62 72 65 61 | 6b 3b 0d 20 20 20 20 20 | brea|k;. |
|00005c30| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 20 20 20 | }|. |
|00005c40| 20 7d 20 20 20 20 0d 20 | 20 7d 0d 72 65 74 75 72 | } . | }.retur|
|00005c50| 6e 28 72 65 74 75 72 6e | 56 61 6c 29 3b 0d 7d 0d |n(return|Val);.}.|
|00005c60| 4d 50 57 20 50 61 73 63 | 61 6c 0d 7b 20 59 6f 75 |MPW Pasc|al.{ You|
|00005c70| 72 20 66 69 6c 74 65 72 | 20 66 6f 72 20 70 72 65 |r filter| for pre|
|00005c80| 2d 53 79 73 74 65 6d 20 | 37 20 77 69 6c 6c 20 6c |-System |7 will l|
|00005c90| 6f 6f 6b 20 73 6f 6d 65 | 74 68 69 6e 67 20 6c 69 |ook some|thing li|
|00005ca0| 6b 65 20 74 68 69 73 3a | 20 7d 0d 46 55 4e 43 54 |ke this:| }.FUNCT|
|00005cb0| 49 4f 4e 20 4d 79 46 69 | 6c 74 65 72 28 63 75 72 |ION MyFi|lter(cur|
|00005cc0| 72 65 6e 74 44 69 61 6c | 6f 67 3a 20 44 69 61 6c |rentDial|og: Dial|
|00005cd0| 6f 67 50 74 72 3b 20 56 | 41 52 20 74 68 65 45 76 |ogPtr; V|AR theEv|
|00005ce0| 65 6e 74 49 6e 3a 20 45 | 76 65 6e 74 52 65 63 6f |entIn: E|ventReco|
|00005cf0| 72 64 3b 20 56 41 52 20 | 74 68 65 49 74 65 6d 3a |rd; VAR |theItem:|
|00005d00| 20 49 4e 54 45 47 45 52 | 29 3a 20 42 4f 4f 4c 45 | INTEGER|): BOOLE|
|00005d10| 41 4e 3b 0d 43 4f 4e 53 | 54 20 0d 6b 4d 79 42 75 |AN;.CONS|T .kMyBu|
|00005d20| 74 74 6f 6e 44 65 6c 61 | 79 20 3d 20 38 3b 0d 56 |ttonDela|y = 8;.V|
|00005d30| 41 52 0d 20 20 69 74 65 | 6d 4b 69 6e 64 20 20 20 |AR. ite|mKind |
|00005d40| 20 20 20 3a 20 49 4e 54 | 45 47 45 52 3b 0d 20 20 | : INT|EGER;. |
|00005d50| 69 74 65 6d 48 61 6e 64 | 6c 65 20 20 20 20 3a 20 |itemHand|le : |
|00005d60| 48 61 6e 64 6c 65 3b 0d | 20 20 69 74 65 6d 52 65 |Handle;.| itemRe|
|00005d70| 63 74 20 20 20 20 20 20 | 3a 20 52 65 63 74 3b 0d |ct |: Rect;.|
|00005d80| 20 20 73 61 76 65 50 6f | 72 74 20 20 20 20 20 20 | savePo|rt |
|00005d90| 3a 20 47 72 61 66 50 74 | 72 3b 0d 20 20 77 61 69 |: GrafPt|r;. wai|
|00005da0| 74 54 69 63 6b 73 20 20 | 20 20 20 3a 20 4c 4f 4e |tTicks | : LON|
|00005db0| 47 49 4e 54 3b 0d 42 45 | 47 49 4e 0d 20 20 7b 20 |GINT;.BE|GIN. { |
|00005dc0| 69 66 20 74 68 65 20 75 | 70 64 61 74 65 20 69 73 |if the u|pdate is|
|00005dd0| 20 66 6f 72 20 74 68 65 | 20 64 69 61 6c 6f 67 20 | for the| dialog |
|00005de0| 62 6f 78 2c 20 69 67 6e | 6f 72 65 20 69 74 20 73 |box, ign|ore it s|
|00005df0| 69 6e 63 65 20 74 68 65 | 20 72 65 67 75 6c 61 72 |ince the| regular|
|00005e00| 20 4d 6f 64 61 6c 44 69 | 61 6c 6f 67 0d 20 20 7b | ModalDi|alog. {|
|00005e10| 20 66 75 6e 63 74 69 6f | 6e 20 77 69 6c 6c 20 72 | functio|n will r|
|00005e20| 65 64 72 61 77 20 69 74 | 20 61 73 20 6e 65 63 65 |edraw it| as nece|
|00005e30| 73 73 61 72 79 20 7d 0d | 20 20 49 46 20 28 74 68 |ssary }.| IF (th|
|00005e40| 65 45 76 65 6e 74 49 6e | 2e 77 68 61 74 20 3d 20 |eEventIn|.what = |
|00005e50| 75 70 64 61 74 65 45 76 | 74 20 41 4e 44 20 74 68 |updateEv|t AND th|
|00005e60| 65 45 76 65 6e 74 49 6e | 2e 6d 65 73 73 61 67 65 |eEventIn|.message|
|00005e70| 20 3c 3e 20 63 75 72 72 | 65 6e 74 44 69 61 6c 6f | <> curr|entDialo|
|00005e80| 67 29 0d 20 20 20 20 4d | 79 46 69 6c 74 65 72 20 |g). M|yFilter |
|00005e90| 3a 3d 20 4d 79 44 72 61 | 77 50 72 6f 63 28 74 68 |:= MyDra|wProc(th|
|00005ea0| 65 45 76 65 6e 74 49 6e | 2e 6d 65 73 73 61 67 65 |eEventIn|.message|
|00005eb0| 29 0d 20 20 45 4c 53 45 | 20 7b 20 69 74 20 77 61 |). ELSE| { it wa|
|00005ec0| 73 6e d5 74 20 61 6e 20 | 75 70 64 61 74 65 2c 20 |sn.t an |update, |
|00005ed0| 73 65 65 20 69 66 20 69 | 74 20 77 61 73 20 61 20 |see if i|t was a |
|00005ee0| 6b 65 79 73 74 72 6f 6b | 65 20 7d 0d 20 20 20 20 |keystrok|e }. |
|00005ef0| 42 45 47 49 4e 0d 20 20 | 20 20 7b 20 43 68 65 63 |BEGIN. | { Chec|
|00005f00| 6b 20 66 6f 72 20 74 68 | 65 20 72 65 74 75 72 6e |k for th|e return|
|00005f10| 20 6f 72 20 65 6e 74 65 | 72 20 6b 65 79 2c 20 61 | or ente|r key, a|
|00005f20| 6e 64 20 61 6c 69 61 73 | 20 74 68 61 74 20 61 73 |nd alias| that as|
|00005f30| 20 69 74 65 6d 20 22 6f | 6b 22 2e 20 20 7d 0d 20 | item "o|k". }. |
|00005f40| 20 20 20 7b 20 49 20 61 | 6c 73 6f 20 69 6e 63 6c | { I a|lso incl|
|00005f50| 75 64 65 64 20 61 20 63 | 68 65 63 6b 20 68 65 72 |uded a c|heck her|
|00005f60| 65 20 66 6f 72 20 74 68 | 65 20 65 73 63 61 70 65 |e for th|e escape|
|00005f70| 20 6b 65 79 20 61 6c 69 | 61 73 69 6e 67 20 61 73 | key ali|asing as|
|00005f80| 20 69 74 65 6d 20 22 63 | 61 6e 63 65 6c 22 2c 20 | item "c|ancel", |
|00005f90| 7d 0d 20 20 20 20 7b 20 | 79 6f 75 20 6d 61 79 20 |}. { |you may |
|00005fa0| 6e 6f 74 20 77 61 6e 74 | 20 74 6f 20 75 73 65 20 |not want| to use |
|00005fb0| 74 68 61 74 20 7d 0d 20 | 20 20 20 20 20 49 46 20 |that }. | IF |
|00005fc0| 28 28 74 68 65 45 76 65 | 6e 74 49 6e 2e 77 68 61 |((theEve|ntIn.wha|
|00005fd0| 74 20 3d 20 6b 65 79 44 | 6f 77 6e 29 20 4f 52 20 |t = keyD|own) OR |
|00005fe0| 28 74 68 65 45 76 65 6e | 74 49 6e 2e 77 68 61 74 |(theEven|tIn.what|
|00005ff0| 20 3d 20 61 75 74 6f 4b | 65 79 29 29 0d 20 20 20 | = autoK|ey)). |
|00006000| 20 20 20 20 20 42 45 47 | 49 4e 20 7b 20 69 74 20 | BEG|IN { it |
|00006010| 77 61 73 20 61 20 6b 65 | 79 20 7d 0d 20 20 20 20 |was a ke|y }. |
|00006020| 20 20 20 20 0d 20 20 20 | 20 20 20 20 20 20 20 43 | . | C|
|00006030| 41 53 45 20 43 48 52 28 | 42 41 6e 64 28 74 68 65 |ASE CHR(|BAnd(the|
|00006040| 45 76 65 6e 74 49 6e 2e | 6d 65 73 73 61 67 65 2c |EventIn.|message,|
|00006050| 20 63 68 61 72 43 6f 64 | 65 4d 61 73 6b 29 29 20 | charCod|eMask)) |
|00006060| 4f 46 0d 20 20 20 20 20 | 20 20 20 20 20 0d 20 20 |OF. | . |
|00006070| 20 20 20 20 20 20 20 20 | 20 20 6b 52 65 74 75 72 | | kRetur|
|00006080| 6e 4b 65 79 2c 20 6b 45 | 6e 74 65 72 4b 65 79 3a |nKey, kE|nterKey:|
|00006090| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 42 |. | B|
|000060a0| 45 47 49 4e 0d 20 20 20 | 20 20 20 20 20 20 20 20 |EGIN. | |
|000060b0| 20 20 20 20 20 47 65 74 | 44 49 74 65 6d 28 63 75 | Get|DItem(cu|
|000060c0| 72 72 65 6e 74 44 69 61 | 6c 6f 67 2c 20 6f 6b 2c |rrentDia|log, ok,|
|000060d0| 20 69 74 65 6d 4b 69 6e | 64 2c 20 69 74 65 6d 48 | itemKin|d, itemH|
|000060e0| 61 6e 64 6c 65 2c 20 69 | 74 65 6d 52 65 63 74 29 |andle, i|temRect)|
|000060f0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00006100| 20 20 48 69 6c 69 74 65 | 43 6f 6e 74 72 6f 6c 28 | Hilite|Control(|
|00006110| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 28 69 74 |ControlH|andle(it|
|00006120| 65 6d 48 61 6e 64 6c 65 | 29 2c 20 54 52 55 45 29 |emHandle|), TRUE)|
|00006130| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00006140| 20 20 44 65 6c 61 79 28 | 6b 4d 79 42 75 74 74 6f | Delay(|kMyButto|
|00006150| 6e 44 65 6c 61 79 20 2c | 20 77 61 69 74 54 69 63 |nDelay ,| waitTic|
|00006160| 6b 73 29 3b 20 20 7b 20 | 77 61 69 74 20 61 62 6f |ks); { |wait abo|
|00006170| 75 74 20 38 20 74 69 63 | 6b 73 20 73 6f 20 74 68 |ut 8 tic|ks so th|
|00006180| 65 79 20 63 61 6e 0d 09 | 09 09 09 09 09 09 20 20 |ey can..|...... |
|00006190| 20 20 73 65 65 20 69 74 | 20 7d 0d 20 20 20 20 20 | see it| }. |
|000061a0| 20 20 20 20 20 20 20 20 | 20 20 20 48 69 6c 69 74 | | Hilit|
|000061b0| 65 43 6f 6e 74 72 6f 6c | 28 43 6f 6e 74 72 6f 6c |eControl|(Control|
|000061c0| 48 61 6e 64 6c 65 28 69 | 74 65 6d 48 61 6e 64 6c |Handle(i|temHandl|
|000061d0| 65 29 2c 20 46 41 4c 53 | 45 29 3b 20 20 7b 20 61 |e), FALS|E); { a|
|000061e0| 6e 64 20 62 61 63 6b 20 | 74 6f 20 09 09 09 09 09 |nd back |to .....|
|000061f0| 09 09 09 09 20 20 20 6e | 6f 72 6d 61 6c 20 7d 0d |.... n|ormal }.|
|00006200| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006210| 4d 79 46 69 6c 74 65 72 | 20 3a 3d 20 54 52 55 45 |MyFilter| := TRUE|
|00006220| 3b 20 20 20 20 20 20 20 | 20 20 20 20 7b 20 74 65 |; | { te|
|00006230| 6c 6c 20 74 68 65 20 44 | 69 61 6c 6f 67 20 4d 61 |ll the D|ialog Ma|
|00006240| 6e 61 67 65 72 20 77 65 | 20 68 61 6e 64 6c 65 64 |nager we| handled|
|00006250| 20 09 09 09 09 09 09 20 | 28 20 74 68 69 73 20 65 | ...... |( this e|
|00006260| 76 65 6e 74 20 7d 0d 20 | 20 20 20 20 20 20 20 20 |vent }. | |
|00006270| 20 20 20 20 20 45 4e 44 | 3b 0d 20 20 20 20 20 20 | END|;. |
|00006280| 20 20 20 20 20 20 20 20 | 0d 20 20 20 20 20 20 20 | |. |
|00006290| 20 20 20 20 20 6b 45 73 | 63 4b 65 79 3a 0d 20 20 | kEs|cKey:. |
|000062a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 42 45 47 49 | | BEGI|
|000062b0| 4e 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |N. | |
|000062c0| 20 20 74 68 65 49 74 65 | 6d 20 3a 3d 20 63 61 6e | theIte|m := can|
|000062d0| 63 65 6c 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |cel;. | |
|000062e0| 20 20 20 20 20 47 65 74 | 44 49 74 65 6d 28 63 75 | Get|DItem(cu|
|000062f0| 72 72 65 6e 74 44 69 61 | 6c 6f 67 2c 20 63 61 6e |rrentDia|log, can|
|00006300| 63 65 6c 2c 20 69 74 65 | 6d 4b 69 6e 64 2c 20 69 |cel, ite|mKind, i|
|00006310| 74 65 6d 48 61 6e 64 6c | 65 2c 20 69 74 65 6d 52 |temHandl|e, itemR|
|00006320| 65 63 74 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |ect);. | |
|00006330| 20 20 20 20 20 20 48 69 | 6c 69 74 65 43 6f 6e 74 | Hi|liteCont|
|00006340| 72 6f 6c 28 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |rol(Cont|rolHandl|
|00006350| 65 28 69 74 65 6d 48 61 | 6e 64 6c 65 29 2c 20 54 |e(itemHa|ndle), T|
|00006360| 52 55 45 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |RUE);. | |
|00006370| 20 20 20 20 20 20 44 65 | 6c 61 79 28 6b 4d 79 42 | De|lay(kMyB|
|00006380| 75 74 74 6f 6e 44 65 6c | 61 79 20 2c 20 77 61 69 |uttonDel|ay , wai|
|00006390| 74 54 69 63 6b 73 29 3b | 20 20 7b 20 77 61 69 74 |tTicks);| { wait|
|000063a0| 20 61 62 6f 75 74 20 38 | 20 74 69 63 6b 73 20 73 | about 8| ticks s|
|000063b0| 6f 20 74 68 65 79 20 63 | 61 6e 0d 09 09 09 09 09 |o they c|an......|
|000063c0| 09 09 20 20 20 20 73 65 | 65 20 69 74 20 7d 0d 20 |.. se|e it }. |
|000063d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 48 | | H|
|000063e0| 69 6c 69 74 65 43 6f 6e | 74 72 6f 6c 28 43 6f 6e |iliteCon|trol(Con|
|000063f0| 74 72 6f 6c 48 61 6e 64 | 6c 65 28 69 74 65 6d 48 |trolHand|le(itemH|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.